Salesforce Fact #916 | Adding validation on UserTerritory2Association

Suppose we would like to add validations while adding users to the territory. For example, The user should be active and the user should not be assigned to multiple territories.

We can write the logic in an after insert trigger on UserTerritory2Association object.

Attached are the sample code snippets.




Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow