You are here:
Row-Level Security Example based on Territory Hierarchy and Record Ownership
If your territory hierarchy is specified with Territory Hierarchy 2.0, you can create a dataset to implement row-level security based on the territory hierarchy and record ownership. This example shows how you do this with a dataset for opportunities.
Prerequisites
Territory Hierarchy in security predicate is a beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com and applicable terms in the Product Terms Directory. To use this feature, contact your Salesforce.com account rep or Customer Support via help.salesforce.com. Use of this beta service is at the Customer's sole discretion.
Source data
This example assumes you have this source data:
Users—here you have 5 users:
Territory hierarchy—here the territories of California and Oregon are grouped under US West, which is included in the US territory:
Territory hierarchy user associations–here users are associated with a territory. For example, John is associated with the territory of California.
Opportunities–here opportunities are identified by the territory in which they originated. For example, opportunity 1 is from California:







