---
schema_version: "1"
id: 2170bd1d67c0c5f68e5c528372e95e1bd6566dd29ad3bb4dd219877b774e6d75
title: Create a Wealth Management Scoping Rule Using the Tooling API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/security/scoping-rules-dev-guide/guides/scoping-rules/quickstart/scoping-rules-quickstart-tooling-api__sales-support.md
canonical_url: https://developer.salesforce.com/docs/platform/scoping-rules-dev-guide/guide/scoping-rules-quickstart-tooling-api__sales-support.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f41ab624123ac4774e5e7169871167572f6696a9c8b8c467b97bab7affca27a3
products:
  - Scoping Rules Developer Guide
  - Security
---

# 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.

|Required Editions|
|-----------------|
|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|

**note:** 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.

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.](https://developer.salesforce.com/media/scoping-rules-dev-guide/scoping_rules_wealth_mgmt_diagram.png)

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](https://developer.salesforce.com/docs/atlas.en-us.restriction_rules.meta/restriction_rules/tooling_api_objects_restrictionrule.htm).

    In this example, we used these values.

    ```nolang
    {
        "FullName": "SalesSupportAssociateScopingRule",
        "Metadata": {
            "active": true,
            "description": "Sales support associate sees only account records of of Advisor1",
            "enforcementType": "Scoping",
            "masterLabel": "Advisor1 Record Set",
            "recordFilter": "SOQL(id, SELECT Account__c FROM Client_Entitlement__c USING SCOPE EVERYTHING
    	WHERE Team_Entitlement__c IN (
    		SELECT Team_Entitlement__c
    		FROM User_Entitlement__c
    			USING SCOPE EVERYTHING
    		WHERE User__c = $User.id)
    	)",
            "targetEntity": "Account",
            "userCriteria": "$User.ProfileId = '00exxxxxxxxxxxx'",
            "version": 1
        }
    }
    ```

3.  Use a POST request to create the scoping rule.

    `POST /services/data/`68.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.


