Activity › Forums › Salesforce® Discussions › MIXED-DML-OPERATION
-
MIXED-DML-OPERATION
Posted by chanchal kumar on August 30, 2018 at 11:50 AMWhat is MIXED-DML-OPERATION error and how to avoid?
Parul replied 7 years, 9 months ago 4 Members · 3 Replies -
3 Replies
-
Hello Chanchal,
If we perform DML operation on standard/custom object and global objects(User, UserRole, Group, GroupMember, Permission Set, etc…) in same transaction this error will come.
To avoid this error, we should perform DML operation on standard/custom object records in a different transaction.
In general all the apex classes and apex triggers execute synchronously (execute immediately).
if we perform DML operation on standard/custom object records asynchronously (execute in future context), we can avoid MIXED-DML-OPERATION error.Thanks.
- [adinserter block='9']
-
Hi,
Mixed DML operations within a single transaction aren’t allowed. You can’t perform DML on a setup sObject and another sObject in the same transaction. However, you can perform one type of DML as part of an asynchronous job and the others in other asynchronous jobs or in the original transaction.
Thanks.
-
Hi
If we perform DML operation on standard/custom object and global objects(User, UserRole, Group, GroupMember, Permission Set, etc…) in same transaction this error will come.
Thanks
Log In to reply.