The client is asking to put validation so only one territory can be assigned to an Account, if there is any territory assigned to any account, then the system should not allow assigning any other territory to this account.
Second validation regarding userTerritory2Association object. Here client asking to put some restrictions so only one user can be assigned to a territory and if we try to assign a second user against a territory, the system should not allow.
Any suggestion please I have checked both and there is no solution as such I know because Salesforce doesn't give control to write any trigger on ObjectTerritory2Association Object. Also for my second ques, I have checked before insert triggers don't work on the UserTerritory2Association object that's why I am unable to put validation there.
Need your valuable comments here.
I think you can handle this with the territory filter logic. You will have to be very specific with your territory identifiers. When you break your territories down so that a territory only ever matches one territory filter. Then only ever associate 1 user to the lowest level territory.