You need to sign in to do that
Don't have an account?
Griffindor
DML not allowed on userterritory
Hi,
I have a vf controller from where I need to insert records into the userterritory table. However, I am receiving a compilation error which is as follows:-
Compile Error: DML not allowed on UserTerritory
Is there any way to insert records into the UserTerritory table?
I have tried using an action function to call the controller method, but the compiler does not allow me to save the controller with the insert or the Database insert command on user territory table.
Any help is much appreciated.
Thanks in advance!!
DML operations are not permitted on the UserTerritory object. See "sObjects That Do Not Support DML Operations" in the Apex developer guide.
Hi Chris,
Thanks for your reply. Is there any other way other than apex using which we can do a DML on user territory? We can insert records into user territory using api calls I believe like in the data loader. I need to customize this through code just like the way territory management works for users in the UI.
Looks like you can use the SOAP or REST API to insert a userterritory record. You can see this in action if you use the force.com workbench https://workbench.developerforce.com