Salesforce Trigger is not capturing the field value change on after update context. How to resolve?
This question I recently faced while working on a Trigger having update context. Let’s see the scenario where this question enters into my mind.
Every source stopper is not an issue, some times it just can be a fact/knowledge that we aren’t aware. In order to resolve we have to deep dive, investigate & then comes into the conclusion.
— Shubham Rajput (Software Engineer — Salesforce Developer)
In this scenario, the system needs to update the value of Obj1 object’s field when the checkbox field on Obj2 will be true.
Where I found that, the system was not able to capture the checkbox update event through Trigger & hence it is not updating the value as well.
After making hands dirty way around in search of solution, I got to know the checkbox field is getting updated using Salesforce Flow based on some criteria.
In System, Salesforce Trigger is getting executed first & then Salesforce Flow is executing.
And that’s why the Target value from Obj1 is not updated. Hmm…
So if you face any problem similar to this. Please check that the Triggering field value is getting updated through flow or any other scenario or not.
If yes, then the value will not get updated because according to Salesforce Order of Execution Trigger will always execute first & then the Flow will get execute.
For more information about “Salesforce Order of Execution” you can refer below Diagram/Picture or below links.
Salesforce Order of Execution -
Reference Links —
Follow CodeBiceps Insta Page & Shubham Rajput 🌩️ for more such tips & updates. You can write an email to me for any help or your reviews.
CodeBiceps: https://www.instagram.com/code.biceps
Shubham Rajput🌩️: https://www.linkedin.com/in/shubhamrajputsde
Email: shubham.rajput0369@gmail.com
Stay Connected, Stay Healthy & Spread Knowledge.💫
Till that signing off, The CodeBiceps /> : )