function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
maddukurimaddukuri 

Apex trigger

Hi,

 I have an approval process where I am updating a field x in steps 2,4,6 to "true". In steps 1,3,5 and 7, I am not updating the field at all. In my before update trigger, I need to execute some code only when the field x is true. Can I do that? How can I check in the trigger if the field is updated eventhough to the same value?

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
Starz26Starz26

You can't per say.

 

You would have to have another field that flags as the approval process is running (another field update) then check both fields to be true (set the running value during the same step as the other flag.

 

Then have the trigger uncheck the running check flag

All Answers

Starz26Starz26

You can't per say.

 

You would have to have another field that flags as the approval process is running (another field update) then check both fields to be true (set the running value during the same step as the other flag.

 

Then have the trigger uncheck the running check flag

This was selected as the best answer
maddukurimaddukuri

Thank You Very Much. I will give it a try.