Print this page

MIXED_DML_OPERATION error not thrown during deployment

Knowledge Article Number 000231160
Description You might have a test class with Mixed DML operation such as inserting or updating Accounts, users in a single transaction. The test class when run in the UI will fail with an error stating Mixed DML operations are not possible. However, you do not get that error on test class during deployment. 
Resolution This is Working as Designed. If the same test class is run during deployment, the test class passes without any errors. The reason why test class passes during deployment is that whenever we do a deployment, Mixed DML operations checks are skipped. Hence, the test classes pass without any errors during deployment. 

promote demote