The on success message is displayed on successful submisson of form data. By default, the message "Data Added Successfully" is displayed. If you want to customize this message, you have to specify the same in the success message string as shown below.
on add
{
on success
{
//specify the message here
success message "";
}
}
|
on add
{
on success
{
success message "employee record added";
}
}
|
Example - Using Script Builder
Let us built an on success action script using Script Builder for the Send_Feedback form in Feedback Application. Click here, to view the feedback form.The on success script will send a mail to the email id specified in the Sender field, when a new form data is persisted in the database.
Add Form Actions - On Success
Add Send Mail
Add "Form Actions - On Success"
a. Click on the Script Tab to display the Script Editor.
b. Select the form Send_Feedback from the Select listbox.
c. Select the Form Action On Add -> On Success as highlighted in the screen-shot below.
a. Drag and drop the Send mail function to the editor area, as highlighted in the screen-shot below. Refer the Send mail topic, for more information on the syntax and usage.
b. Click on Edit to specify the To, Subject and Message for Send mail. The Edit dialog displays the default values. To modify the default values, click on the icon on the right-side of each field. For example, to edit the To Address, select the icon highlighted below:

c. The Edit dialog for To Address is displayed. The value specified in the sender field will be taken as the value for To Address. To do this, double-click on the sender field from the list of Input fields. The text input.sender will be added to the text area as highlighted below. Click Done to add this to the To Address.

d. Similarly, you can add the "Message" in the sendmail as the value specified in the category and comments field. Click Done to update the changes in the Message box of the Send Mail Edit dialog.

e. When you have specified the values to the To, Subject and Message of the Send Mail dialog, click Done to add the values to the script editor.
f. The send mail script is added to the script editor as shown below. Click Save Script to add the script changes.
Add "Success Message" : On successful submisson of form data, the message "Data Added Successfully" is displayed by default. If you want to customize this message, you have to specify the same in the success message string as shown below. To do this,
a. Drag and drop the Success message to the editor area. Click on Edit and specify the message.
b. The Edit dialog for the success message is displayed. You can specify any text within quotes. The input field values can also be appended to the message string using the "+" operator. Click on Done to add the script in script editor.

c. The on success script is added to the script editor. Click on Save Script to update the changes. When the form data is persisted in the database, the script will send a mail and display the specified success message.
To view the complete script, select Form Definition -> With Action or select Free-flow Scripting. The on success script is successfully added to the form definition, as shown below.
The on success script will send a mail to the email id specified in the Sender field, after the form data is persisted in the database.

The success message specified in the script is displayed as shown in the scree-shot below:
