Newer Version Available
Create the Restriction Rule Using the Metadata API
Create a restriction rule that controls which tasks members of the Sales Team can access
using the RestrictionRule Metadata API type.
| Available in: Lightning Experience in Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create and manage restriction rules: | Manage Sharing |
| To view restriction rules: | View Setup & Configuration AND View Restriction and Scoping Rules |
You can create up to two restriction rules per object in Enterprise and Developer Editions and up to five restriction rules per object in Performance and Unlimited Editions.
-
Set up the package.xml manifest file and your
directory.
Example package.xml file:
Example directory:
-
Include all required fields. For more information, see the reference topic RestrictionRule.
For our example, we set the fields as follows:
- Zip your directory and deploy your changes. For more information, see Deploying and Retrieving Metadata in the Metadata API Developer Guide.
- Note the ID returned for the newly created restriction rule for later reference.