1

I Have an email template  which is fired whenever a text value is updated on the field named ABC.  Here I am getting updated text values only. But my requirement is to get the history of the field (Old value & New Value) on the VF Page Email Template.

Is there any possibility to get each and every value of history which is updated by the user on the email template. Kindly let me know how can I achieve this. Can we use apex class to get these values. If possible kindly refer me some examples. I am referring to get the history values from the custom object and the values from the history of the field on the object(By tracking the field history)

1 Answer 1

2

You can use a before update Flow or an apex trigger to write the old value to a custom field. Then you can reference the field that has old value in your email template.

Using Flow

When a record is updated, you can access that record’s prior values in Salesforce Flow. The $Record__Prior global variable contains the record’s values immediately before the flow was run.

Using Trigger

Trigger.oldMap and Trigger.old has these values.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.