Skip to main content

I wish to check the old and new value of formula field and perform some action based on that if the formula field value has been changed.

For example, I wish to take note of datetime when the formula field is changed and keep that datetime in some custom field.

But the formula fields are not available in triggers and also the formula field changes does not execute triggers?

 

#Salesforce Development

So any approach line around that?

2 个回答
  1. 2021年7月5日 17:11

    Hi Chandra,

     

    Formula fields are available in triggers/trigger context variables. But, because formula fields are calculated on demand (My Understanding they are not part of backend table). Everytime, fetch/query a record, formula fields are calculated so no DML. 

     

    So for your usecase, you should move your logic to trigger or workflow to perform formula calculation and update the record.