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.
Retrieve and Update Information
| Available in: Lightning Experience in Enterprise, Performance, Unlimited, and Developer Editions |
Retrieve
To retrieve information about your restriction rule, use the GET method.
Example HTTP Method and URI:
GET /services/data/v55.0/tooling/query/?q=SELECT+id,+targetEntity,+enforcementType,+recordFilter,+userCriteria+FROM+RestrictionRuleUpdate
To update the restriction rule, use the PATCH method.
We recommend that you don’t update the value of targetEntity after the restriction rule is created. Instead, delete the restriction rule and create another one with the correct values.
Example HTTP Method and URI:
PATCH /services/data/v55.0/tooling/sobjects/RestrictionRule/0eYxxxxxxxxxxxx2AYReplace 0eYxxxxxxxxxxxx2AY with the ID returned when creating the restriction rule.
Example Request Body:
All Metadata fields must be included, even if you aren’t updating them. Specify the FullName value only if you’re changing this field.
In this example, we deactivate the restriction rule by setting active to false.
1{
2 "Metadata": {
3 "active": false,
4 "description": "Sales team can see only task records with specified record type",
5 "enforcementType": "Restrict",
6 "masterLabel": "Sales Team Record Type",
7 "recordFilter": "recordTypeId = '011xxxxxxxxxxxx'",
8 "targetEntity": "Task",
9 "userCriteria": "$User.ProfileId = '00exxxxxxxxxxxx'",
10 "version": 1
11 }
12}Delete
To delete a restriction rule, use the DELETE method.
Example HTTP Method and URI:
DELETE /services/data/v55.0/tooling/sobjects/RestrictionRule/0eYxxxxxxxxxxxx2AYReplace 0eYxxxxxxxxxxxx2AY with the ID returned when creating the restriction rule.