How can I check if the owner of an account is in the territory through groovy script?
Currently, In Oracle CX Sales, I have a custom DCL field named 'Secondary Owner'. This field is linked to the Resource object. When a resource is selected in the DCL, a 'BeforeUpdate' trigger is activated that adds the Secondary Owner's resource to the Sales team. In doing so, we now allow for users outside of the territory/hierarchy to also view this account. However, now we want to limit the ability to edit this 'Secondary Owner' customer field to only be editable by users in the territory of the account.
I have used the following source as a reference but not sure if that works is the best way to go about it:
0