You need to sign in to do that
Don't have an account?
Anu Yadav
Assign the new user to one of the territories by inserting into the UserTerritory object in Test class
Hi,
I m trying write a test class in which i have to Assign the new user to one of the territories by inserting into the UserTerritory object .
I have created a dummy user and dummy territory. Unable to perform the same for UserTerritory.
i m getting error as DML not allowed on UserTerritory. It can be solved by applying (SeeAllData=true) but it os not the correct way.
Please help.
Thanks.
I m trying write a test class in which i have to Assign the new user to one of the territories by inserting into the UserTerritory object .
I have created a dummy user and dummy territory. Unable to perform the same for UserTerritory.
i m getting error as DML not allowed on UserTerritory. It can be solved by applying (SeeAllData=true) but it os not the correct way.
Please help.
Thanks.
just go through the links below
https://success.salesforce.com/answers?id=90630000000h92hAAA
http://salesforce.stackexchange.com/questions/14530/create-user-with-territory-for-runas-in-test-method (https://success.salesforce.com/answers?id=90630000000h92hAAA)
Regards,
Roshni