Forum Post: RE: How can i send email on change of fields in single trigger

  • Thread starter Thread starter Gian Torralba
  • Start date Start date
Status
Not open for further replies.
G

Gian Torralba

Guest
HI Sudhakar, Since you can't use the #before values in the email templates. What I'm thinking of is to create fields that will hold the previous values and then comparing it and generating the phrase in a formula field. Please follow the trigger hierarchy: Send email trigger (Send Email | After Update) Update previous field values (Object Script | After Update) These are the steps you must follow: Create fields that will hold the previous values e.g (previous phone number) Create a formula field that will be used in the email template to show/hide words that are not needed Create an email trigger Create the object script that will have the rbv_api.setFieldValue() API for updating multiple fields in a single trigger (to avoid using different update field value trigger In your send email trigger compare the previous field and the new field. This will send the email only if there is a change in the conditions specified below e.g if("my name" != "my new name" || "my number" != "my new number") return true; In your formula (type string) field that will create the content: var content = ""; if("my name" != "my new name") content += "name is changed from abc to efg /br "; if("my number" != "my new number") content += "number is changed from 123 to 456 /br "; return content; Hope this helps, Thanks, Gian

Continue reading...
 
Status
Not open for further replies.
Back
Top