G
Gian Torralba
Guest
Hi Sudhakar, Please follow this steps: 1. Create two text fields that will hold the previous value of those group check box fields. 2. Create an after update trigger that will update the newly created fields. The trigger should contain a code somewhat similar to this: return "{!group_cb#value}" /*if the value is an array, use javascript join() method to join the arrays into a string*/ 3. Create a send email after update trigger that has a condition similar to this: var newVal = "{!group_cb#value}"; newVal = newVal.join(","); var prevVal = "{!prev_cb#value}"; var newVal2 = "{!group_cb_2#value}"; newVal2 = newVal2.join(","); var prevVal2 = "{!prev_cb_2#value}"; if(newVal != prevVal || newVal2 != prevVal2) return true; 4. Create a formula field that will be inside the email template. This will contain the dynamic value of those check boxes that needs to be displayed. Please follow this sample code: var newVal = "{!group_cb#value}"; newVal = newVal.join(","); var prevVal = "{!prev_cb#value}"; var newVal2 = "{!group_cb_2#value}"; newVal2 = newVal2.join(","); var prevVal2 = "{!prev_cb_2#value}"; var outputText = ''; if(newVal != prevVal) outputText += "Loan Cannot Be Sold To (Approved)"; if(newVal2 != prevVal2) outputText += "Loan Cannot Be Sold To (CTC)"; return outputText; 5. The trigger hierarchy should be like this: - 1. Send Email - 2. Update previous field value Hope this helps. Let me know if you have any questions. Thank you, Gian
Continue reading...
Continue reading...