Newer Version Available

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

Create a Wealth Management Scoping Rule Using the Tooling 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 Tooling API object.
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

You can use the RestrictionRule object to create and manage both restriction rules and scoping rules. For information on restriction rules, see the Restriction Rule Developer Guide.

Note

This example uses the SOQL operator in the recordFilter field to determine which accounts to display to the user based on the account, team, and user entitlements.Diagram illustrating the entitlement junction objects that connect the client (account) object to the user object, determining the user's access.
  1. Set a value for the FullName value (the full name of the associated metadata object in Metadata API).
  2. Include all other required fields. For more information, see the reference topic RestrictionRule.

    In this example, we used these values.

    1{
    2    "FullName": "SalesSupportAssociateScopingRule",
    3    "Metadata": {
    4        "active": true,
    5        "description": "Sales support associate sees only account records of of Advisor1",
    6        "enforcementType": "Scoping",
    7        "masterLabel": "Advisor1 Record Set",
    8        "recordFilter": "SOQL(id, SELECT Account__c FROM Client_Entitlement__c USING SCOPE EVERYTHING
    9	WHERE Team_Entitlement__c IN (
    10		SELECT Team_Entitlement__c
    11		FROM User_Entitlement__c
    12			USING SCOPE EVERYTHING
    13		WHERE User__c = $User.id)
    14	)",
    15        "targetEntity": "Account",
    16        "userCriteria": "$User.ProfileId = '00exxxxxxxxxxxx'",
    17        "version": 1
    18    }
    19}
  3. Use a POST request to create the scoping rule.
    POST /services/data/61.0/tooling/sobjects/RestrictionRule
  4. Copy your scoping rule definition into the request body.
  5. Execute your request. Copy the ID returned for the scoping rule for later reference.