Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Display a Department’s Records 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.
| Available in: Lightning Experience in Performance,Unlimited, and Developer editions. |
Tooling API
1{
2 "FullName":"Department A contact scoping rule",
3 "Metadata": {
4 "active":true,
5 "description":"View contacts from Department A.",
6 "enforcementType":"Scoping",
7 "masterLabel":"SR for Department A",
8 "recordFilter":"Department=$User.Department",
9 "targetEntity":"Contact",
10 "userCriteria":"$User.UserRoleId = '00Exxxxxxxxxxxx'",
11 "version":1
12 }
13}Metadata API
1<?xml version="1.0" encoding="UTF-8"?>
2<RestrictionRule xmlns="http://soap.sforce.com/2006/04/metadata">
3 <active>true</active>
4 <description>View tasks contacts from Department A.</description>
5 <enforcementType>Scoping</enforcementType>
6 <masterLabel>SR for Department A contacts</masterLabel>
7 <recordFilter>Department=$User.Department</recordFilter>
8 <targetEntity>Contact</targetEntity>
9 <userCriteria>$User.UserRoleId = '00Exxxxxxxxxxxx'</userCriteria>
10 <version>1</version>
11</RestrictionRule>