some fields on orderitem can only be changed when the order is changed, so I need orderitem trigger to know if it's triggered by order trigger. how can I do this?
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 community
One way to achieve this is using a static variable. In your Util or other similar class, define a static variable called inOrderTrigger.
public static inOrderTrigger = false;
Then in your order trigger, set it to be true.
Then in your orderitem trigger, you can check the value of that static variable.