Field Actions - On update
Description
If you want to perform action whenever the value of a field is modified,
you can write an on update script for that field. The
on update script is executed after the changed data is persisted in the
database.
Syntax
Example
Let us take the example of a Feedback Application form. In the
below sample, whenever the status of a feedback is changed to Closed,
a mail will be sent to the person who had reported it.
form Feedback_Form
{
displayname = "Feedback Form"
Your_Email_Address
(
displayname = "Your Email Address"
type = email
)
Feedback_Category
(
displayname = "Feedback Category"
type = picklist
values = {"Feature Request", "Suggestion For Improvement", "Bug Report", "Usability"}
)
Comments
(
type = textarea
on update
{
if (input.Status == "Closed")
{
sendmail
(
To : input.Your_Email_Address
Subject : "The feedback you had sent has been incorporated in zohocreator"
Message : "The details are as below" + "Category " + input.Feedback_Category + "" + "Comments " + input.Comments
)
}
}
)
Status
(
type = picklist
values = {"Open", "In-Progress", "Closed"}
)
on add
{
on success
{
sendmail
(
To : input.Your_Email_Address
Subject : "Your request has been registered with us"
Message : input.Feedback_Category + input.Comments
)
success message "Email sent to" + " " + input.Your_Email_Address;
}
}
}
}
|
|