Activity › Forums › Salesforce® Discussions › How to avoid mixed_DML_operation error in test class in Salesforce? Salesforce® Discussions How to avoid mixed_DML_operation error in test class in Salesforce? Posted by Anjali on June 4, 2020 at 2:56 PM How to avoid mixed_DML_operation error in test class in Salesforce? Aditya replied 5 years, 12 months ago 4 Members · 3 Replies 3 Replies Deepak Member June 4, 2020 at 3:11 PM Use @future to Bypass the Mixed DML Error in a Test Method [adinserter block='9'] Pooja Member June 4, 2020 at 3:11 PM Use @future to Bypass the Mixed DML Error in a Test Method 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. Aditya Member June 4, 2020 at 3:16 PM By using @future method, we avoid the mixed Dml exception in Salesforce Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me