What This Error Means?
Mixed DML Operation error occurs when Salesforce identifies an attempt within a single transaction to modify setup object data (such as Users or Permissions) and business object data (such as Accounts or Custom Objects) at the same time. Salesforce does not permit the execution of these two updates together.
When this happens, Salesforce stops the transaction and throws the Mixed DML Operation error to prevent inconsistent data changes.
