Activity Forums Salesforce® Discussions MIXED-DML-OPERATION

  • shradha jain

    Member
    August 30, 2018 at 12:06 pm

    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.

  • madhulika shah

    Member
    September 19, 2018 at 1:17 pm

    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.

  • Parul

    Member
    September 19, 2018 at 1:22 pm

    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.

Popular Salesforce Blogs

Popular Salesforce Videos