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.
Allow Users to See Records Based on a Custom Field
This restriction rule allows high-volume users to see only the contracts where the
user's department matches the contract's department. This rule uses a custom field,
Department__c, that must have the appropriate value set through
Apex, Process Builder, workflows, or flows.
| Available in: Lightning Experience in Enterprise, Performance, Unlimited, and Developer Editions |
Tooling API
1{
2 "FullName":"Contract restriction rule for Customer Community",
3 "Metadata": {
4 "active":true,
5 "description":"Show high-volume user by department",
6 "enforcementType":"Restrict",
7 "masterLabel":"RR for Internal Contracts",
8 "recordFilter":"Department__c = $User.Department",
9 "targetEntity":"Contract",
10 "userCriteria":"$User.UserType = 'CSPLitePortal'",
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>Show high-volume user by department</description>
5 <enforcementType>Restrict</enforcementType>
6 <masterLabel>RR for Internal Contracts</masterLabel>
7 <recordFilter>Department__c = $User.Department</recordFilter>
8 <targetEntity>Contract</targetEntity>
9 <userCriteria>$User.UserType = 'CSPLitePortal'</userCriteria>
10 <version>1</version>
11</RestrictionRule>