Newer Version Available

This content describes an older version of this product. View Latest

RestrictionRule (Beta)

Represents a restriction rule that controls the access that specified users have to designated records. This object is available in API version 52.0 and later.

This feature is a Beta Service. Customer may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.

Note

Supported SOAP API Calls

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

Supported REST API Methods

DELETE, GET, HEAD, PATCH, POST, Query

Special Access Rules

To enable restriction rules, contact Salesforce Customer Support. Only users with the Manage Sharing permission can create restriction rules.

Fields

Field Details
Description
Type
textarea
Properties
Filter, Group, Nillable, Sort
Description
Required. The description of the rule.
DeveloperName
Type
string
Properties
Filter, Group, Sort
Description
The unique name for the RestrictionRule object.
This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is automatically generated, but you can supply your own value if you create the record using the API.
EnforcementType
Type
picklist
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
Required. The type of rule.
Possible values are:
  • FieldRestrict—Do not use.
  • Restrict—Restriction rule. Only this value is valid.
  • Scoping—Do not use.
FullName
Type
string
Properties
Create, Group, Nillable
Description
Required. The full name of the associated RestrictionRule in Metadata API. The full name can include a namespaceprefix.
Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.
IsActive
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the rule is active (true) or not (false). The default value is false.
Language
Type
picklist
Properties
Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The language of the rule. The value for this field is the language value of the org.
MasterLabel
Type
string
Properties
Filter, Group, Sort
Description
Label for the rule.
Metadata
Type
mns:RestrictionRule
Properties
Create, Nillable, Update
Description
The restriction rule’s metadata.
Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.
RecordFilter
Type
textarea
Properties
Create, Filter, Group, Sort, Update
Description
Required. The criteria that determine which records are accessible via the rule.
TargetEntity
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
Required. The object for which you're creating the rule. Custom objects and the Contract, Event, and Task objects are supported. We recommend that you don’t edit this field after the restriction rule is created.
UserCriteria
Type
textarea
Properties
Create, Filter, Group, Sort, Update
Description
Required. The users that this rule applies to, such as all active users or users with a specified role or profile.
Version
Type
int
Properties
Filter, Group, Sort
Description
Required. The rule's version number.

Usage

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.

Create only one restriction rule per object per user. In other words, for a given object, only one restriction rule at most should have the UserCriteria field evaluate to true for a given user.

For more information on restriction rules, see the Restriction Rules Developer Guide (Beta).