You need to sign in to do that
Don't have an account?
Bard09
Email Template-- Show Previous/Trigger.old data?
Hey all,
Is there a way to display previous change data for fields on a Visualforce e-mail template, similar to Apex's trigger.old?
Eg "The Opportunity name has changed. Old value: XYZ. New Value: ABC".
I know I can 100% do this by coding the e-mail template in Apex-- but I really would prefer to write these sorts of e-mails with Visualforce if at all possible.
If anyone knows anything, it would be MUCH appreciated.
Thanks!
I ultimately went down the rabbit hole and implemented the necessary notifications in Apex. It's a PITA having to manage HTML templates there, but it gets the job done.
All Answers
Anyone? :)
if you just want to show the old and new values you can even create a dummy field and do it by work flow rule, just create a field called Opp Name (old) and in the WFR select formula
ISCHANGED(Name) then field update new field__c with formula PRIORVALUE(Name)
hope this helps
I wish there was native support for this. It's a common pattern (an email alert when something has changed, to show the old & new values.)
I ultimately went down the rabbit hole and implemented the necessary notifications in Apex. It's a PITA having to manage HTML templates there, but it gets the job done.
Good to know. Like you, I know it could be done that way, but hesitant to write a bunch of code for what could be a configuration item.