function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShraddhaShraddha 

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.

Bard09Bard09

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?