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
chirugantachiruganta 

How to change the territory of an account in apex?

Is it possible to change the Territory of an account? If yes, please help me.
sraju1.3907075653576648E12sraju1.3907075653576648E12
Hi,

Please try the algorithm provided in the following link: there is sample SOQL which you can run and test to if if you get the assignment correct:
Territory is not a separate object as such in salesforce but its a group ID which represents a Territory:

https://developer.salesforce.com/forums?id=906F00000008w0uIAA
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yGQIAY 
chirugantachiruganta
I have tried using those queries but I it is not changing the territory of an account.