+ Start a Discussion

Deleting Territory through Apex code

Hi...I have written one Trigger on Territory delete ....But I am not able to cover that trigger code in my Test method . When I try to delete territory through my Apex Test class it gives me an " error : DML not allowed on Territory " .... So please let me know if there is any way to cover that code in my Test method.


I know this post is almost 4 years old now, but I just ran into the same problem myself.  Wrote a trigger to execute when Territories are deleted, but can't create test coverage without the DML operation.


Anyone have a workaround?