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 Branch Location’s Records 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.
Available in: Lightning Experience in Performance,Unlimited, and Developer editions.

Tooling API

1{
2    "FullName":"Task scoping rule on Bank Branch 1",
3    "Metadata": {
4         "active":true,
5         "description":"View tasks for Bank Branch 1.",
6         "enforcementType":"Scoping",
7         "masterLabel":"SR for Bank Branch 1",
8         "recordFilter":"Branch__c = $User.Branch__c",
9         "targetEntity":"Task",
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 for Bank Branch 1.</description>
5    <enforcementType>Scoping</enforcementType>
6    <masterLabel>SR for Bank Branch 1</masterLabel>
7    <recordFilter>Branch__c = $User.Branch__c</recordFilter>
8    <targetEntity>Task</targetEntity>
9    <userCriteria>$User.UserRoleId = '00Exxxxxxxxxxxx'</userCriteria>
10    <version>1</version>
11</RestrictionRule>