1

I'm trying to update case owner in after insert trigger but assignment rule is running as per order execution, if criteria doesn't match ,default owner from support settings is being set as an owner. When record get created into Salesforce following Order of execution works: System Validation Rules Apex Before Triggers Custom Validation Rules Duplicate Rules Apex After Triggers Assignment Rules

2
  • You can move the code which updates the case owner from trigger to a future method and call that method from your after insert trigger. So your assignment rule will change to default owner and the future will execute asynchronously from current transaction and change to your desired owner. Feb 17, 2021 at 7:15
  • @VigneshwaranG Thank you, it worked!
    – PayA
    Feb 17, 2021 at 10:25

1 Answer 1

0

You can move the code which updates the case owner from trigger to a future method and call that method from your after insert trigger. So your assignment rule will change to default owner and the future will execute asynchronously from current transaction and change to your desired owner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.