FieldRestrictionRule

Represents a field visibility rule that controls whether a field is visible to a user, based on the field’s inclusion in the PersonalInfo_EPIM field set. If Enhanced Personal Information Management setting was enabled before Spring ’22, field visibility is based on the field’s compliance categorization. This object is available in API version 52.0 and later.

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 access this object, you must have the Manage Sharing permission.
  • To create and manage Employee field visibility rules, you must be assigned a Workplace Command Center permission set license and the Provides access to Workplace Command Center features system permission.
  • To create and manage User field visibility rules, you must enable Digital Experiences and the Enhanced Personal Information Management feature.

Fields

Field Details
Classification
Type
string[]
Properties
Filter
Description
Required. The data classification compliance categorization or field set that is targeted by the rule. The rule applies to fields that are marked with this categorization or included in this field set. If you enabled Enhanced Personal Information Management before Spring ‘22 (API version 54.0), you can use Salesforce's default compliance categorization values or values that you add yourself. If you enabled Enhanced Personal Information Management after Spring ‘22 (API version 54.0), use the PersonalInfo_EPIM field set or a field set that you add yourself.
ClassificationType
Type
ClassificationType (enumeration of type string)
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
The type of classification method used in your org. If you enabled Enhanced Personal Information Management before Spring ‘22 (API version 54.0), use ComplianceCategory. If you enabled Enhanced Personal Information Management after Spring ‘22, use FieldSet.
  • ComplianceCategory
  • FieldSet
The default value is ComplianceCategory.
Available in API version 54.0 and later.
Description
Type
textarea
Properties
Filter, Group, Sort
Description
Required. The description of the rule.
DeveloperName
Type
string
Properties
Filter, Group, Sort
Description
The unique name for the FieldRestrictionRule 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.

When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance may slow while Salesforce generates one for each record.

Note

Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.

Note

EnforcementType
Type
picklist
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
Required. The type of rule.
Possible values are:
  • FieldRestrict—Field visibility rule. Only this value is valid.
  • Restrict—Do not use.
  • Scoping— Do not use.
FullName
Type
string
Properties
Create, Group, Nillable
Description
Required. The full name of the associated FieldRestrictionRule 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 field visibility rule. The value for this field is the language value of the org.
MasterLabel
Type
string
Properties
Filter, Group, Sort
Description
Required. Label for the field visibility rule.
Metadata
Type
mns:FieldRestrictionRule
Properties
Create, Nillable, Update
Description
The field visibility 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 fields are visible to the specified users. For example, the field can check if the logged-in user matches the Employee’s ID.
TargetEntity
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
Required. The object for which you're creating the rule. Only the Employee and User objects are supported.
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.