I have two objects in which Parent is A and Child is B. My Trigger is on A then from that trigger i want to update field of B. In this scenario, which Event of Trigger achieve this?
Thank you..
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI have two objects in which Parent is A and Child is B. My Trigger is on A then from that trigger i want to update field of B. In this scenario, which Event of Trigger achieve this?
Thank you..
It's depend on your requirement. The only thing you need to think about is the trigger context. For example if you need to update child objects based on the Parent object update, you can use after update
trigger context.
Context variable consideration is the most important part for a trigger.
Go through this and try to understand the available trigger context variables and how to use them.
When you are implementing your own trigger, you may face problems and you will learn a lot with them. Very common issue that I have seen is trying to track Id
in before insert
triggers. It's obvious that there is no any Id
available for a record before inserting it to the database.