You need to sign in to do that
Don't have an account?
Karthik Mano
Mixed DML Operation
Hi,
I am inserting new User in After insert and updating existing Users in before Update trigger on Contact. But it doesn't throw me the Mixed DML Operation between setup and non setup objects.
I am doubting if this is any bug in Salesforce or is this the expected function? Because i have previously gone for @Future methods when doing these kind of DMLs. But it doesn't throw me any exception in this case on trigger and the Contact as well as User DMLs are successful.
Any view on this will be helpful. Thanks.
I am inserting new User in After insert and updating existing Users in before Update trigger on Contact. But it doesn't throw me the Mixed DML Operation between setup and non setup objects.
I am doubting if this is any bug in Salesforce or is this the expected function? Because i have previously gone for @Future methods when doing these kind of DMLs. But it doesn't throw me any exception in this case on trigger and the Contact as well as User DMLs are successful.
Any view on this will be helpful. Thanks.
There are two possibilities so you are not getting exception
1) I think you are not getting Mixed DML Operation because after insert and before update are two different transactions, Mixed DML operations are not allowed in single transaction (check debug logs if u have CODE_UNIT_STARTED 2 times under event tab)
2) Assuming you are not inserting or updating any other sobject other than user in after insert and before update trigger then there is no question of getting Mixed DML operation exception as you are not combining setup object with non setup objects.
Best Regards,
Amit Ghadage
Thanks
Best Regards,
Amit Ghadage