+ Start a Discussion
akhil Vakhil V 

Mixed DML Exception in Test Class

Hi,
Got an Mixed Dml Exception in test class how to over come that ? any help ?
ManojjenaManojjena
Hi Akhil ,
Use  Test.startTest() and Test.stopTest() to avoid Mix Dml Exception .It is basicaly throw this exception when you do DML for both setup and nonsetup objects .

Please check below link it will help .

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_non_mix_sobjects_test_methods.htm

Thnaks 
Manoj