• #32688
    Forcetalks

    MIXED-DML-OPERATION

    What is MIXED-DML-OPERATION error and how to avoid?

    #32692
    Forcetalks

    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.

    #35293
    Forcetalks

    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.

    #35298
    Salesforce | Parul Parul #2
    Forcetalks

    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

     

     

Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?