Please read my post before marking as duplicate or irrelevant. :pray:
I have a scenario where I want to update the associated Asset record on Status update.
I have implemented this scenario using
After Update trigger and it is working as expected.
But my senior has different views in my PR review. We are already using
Before Update(for different requirement) so he is asking to move my code to
Before Update and try avoiding additional trigger context. I tried making so many points why we should not use
Before Update in case of updating associated records but he is not approving my PR and asking me for the proofs why
After Update is better than
There is nothing much in code so I am not sharing as it wont be helpful in this case.
I gave few reasons to use
After Update but he is not convienced. Can someone help me with some solid reason to use
- Related Records should always update on
After updatetrigger context as current record is saved to Database and we are sure about the field values.
- Incase of any error, we can avoid the entire execution. (He told me that chances of errors are very less and we should not bother about this scenario).
- Before trigger logic will delay the update process.
- In case of after trigger exceptions can be easily managed and don't consume time.
I know asking this kind of questions are ridiculous and silly. But I am really frustrated and for very small and easy requirement I stuck for the last few days.