Create a Wealth Management Scoping Rule Using the Metadata API
Create a scoping rule that shows a sales support associate who supports multiple
financial advisors only the record set that corresponds to the financial advisor that the
associate is working with. Use the RestrictionRule Metadata API type.
| Available in: Lightning Experience in Performance and Unlimited Editions |
| User Permissions Needed | |
|---|---|
| To create and manage scoping rules: | Manage Sharing |
| To view scoping rules: | View Setup & Configuration AND View Restriction and Scoping Rules |
-
Set up the package.xml manifest file and your
directory.
Example package.xml file:
1<?xml version="1.0" encoding="UTF-8"?> 2<Package xmlns="http://soap.sforce.com/2006/04/metadata"> 3 <types> 4 <members>*</members> 5 <name>RestrictionRule</name> 6 </types> 7 <version>66.0</version> 8</Package>Example directory:
1myPackage/package.xml 2myPackage/restrictionRules 3myPackage/restrictionRules/Rule1.rule 4myPackage/restrictionRules/Rule2.rule -
Include all required fields. For more information, see the reference topic RestrictionRule.
In this example, we used these values.
1<?xml version="1.0" encoding="UTF-8"?> 2<RestrictionRule xmlns="http://soap.sforce.com/2006/04/metadata"> 3 <active>true</active> 4 <description>Sales support associate sees only account records of specified advisor</description> 5 <enforcementType>Scoping</enforcementType> 6 <masterLabel>Advisor1 Record Type</masterLabel> 7 <recordFilter>recordTypeId = '012xxxxxxxxxxxx'</recordFilter> 8 <targetEntity>Account</targetEntity> 9 <userCriteria>$User.ProfileId = '00exxxxxxxxxxxx'</userCriteria> 10 <version>1</version> 11</RestrictionRule> - Zip your directory, and deploy your changes. For more information, see Deploying and Retrieving Metadata in the Metadata API Developer Guide.