You are here:
Scoping Rule Example Scenarios
Refer to these sample scoping rules, which fulfill different access requirements.
Required Editions
| Available in: Lightning Experience |
| Available in: Performance, Unlimited, and Developer Editions |
To implement these examples, navigate to a supported object in the Object Manager and click Scoping Rules.
Display a Branch Location’s Tasks by Default
This scoping rule displays task records associated with a particular bank branch location by default. A custom field called Branch__c stores the bank’s branch locations.
| Criteria | Click Path | Field | Operator | Type | Value |
|---|---|---|---|---|---|
| User Criteria | User | Role ID | $User.UserRoleId | Equals | ID | 00Exxxxxxxxxxxx |
| Record Criteria | Task | Branch__c | [Task].Branch__c | Equals | String | Bank Branch 1 |
Display a Department’s Contacts by Default
This scoping rule displays contact records associated with a particular department by default for a user who works on them. The rule dynamically matches the contact owner's department with the current user's department.
| Criteria | Click Path | Field | Operator | Type | Value |
|---|---|---|---|---|---|
| User Criteria | User | Role ID | $User.UserRoleId | Equals | ID | 00Exxxxxxxxxxxx |
| Record Criteria | Contact | Department | [Contact].Department | Equals | Current User | $User.Department |
Display a Division’s Tasks by Default
This scoping rule displays records associated with a particular division by default for a user.
| Criteria | Click Path | Field | Operator | Type | Value |
|---|---|---|---|---|---|
| User Criteria | User | Profile | $User.Profile | Equals | ID | 00exxxxxxxxxxxx |
| Record Criteria | Task | Assigned To ID (User) Division | [Task].Owner:User:Division | Equals | Current User | $User.Division |
Scope Records Using Multiple String or ID Values in Record Criteria
This scoping rule allows active users to scope the records they see to records whose Name__c field matches the rule’s record criteria value. The record criteria contains strings separated by a comma. ID values are also supported. Double-quotes specify that the value inside the quotes isn’t considered a delimiter.
This rule uses a custom object called Agent__c with a text field called Name__c.
| Criteria | Click Path | Field | Operator | Type | Value |
|---|---|---|---|---|---|
| User Criteria | User | Active | [$User].IsActive | Equals | Boolean | True |
| Record Criteria | Agent__c | Name__c | [Agent__c].Name__c | Equals | String | Tom, Anita, “Torres, Jia” |
This scoping rule allows active users to see records owned by two different managers. In this example, the rule’s record criteria contains IDs separated by a comma.
| Criteria | Click Path | Field | Operator | Type | Value |
|---|---|---|---|---|---|
| User Criteria | User | Active | [$User].IsActive | Equals | Boolean | True |
| Record Criteria | Agent__c | Owner ID (User) Manager ID | [Agent__c].Owner:User:ManagerId | Equals | ID | 001xx000003HNy7, 001xx000003HNut |
