---
schema_version: "1"
id: b096e88d428ec42702d743638539a971f08b54904f9e15d27223280e01161acd
title: Create a Wealth Management Scoping Rule Using the Metadata 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-metadata-api-sales-support.md
canonical_url: https://developer.salesforce.com/docs/platform/scoping-rules-dev-guide/guide/scoping-rules-quickstart-metadata-api-sales-support.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d8e8083947fd823e62fe3934b857edbc2c598a18d8b0881b5a5b5e56f152b0d0
products:
  - Scoping Rules Developer Guide
  - Security
---

# Create a Wealth Management Scoping Rule Using the Metadata 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 Metadata API type.

|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.

1.  Set up the `package.xml` manifest file and your directory.

    Example `package.xml` file:

    ```nolang
    <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
      <types>
        <members>*</members>
        <name>RestrictionRule</name>
      </types>
      <version>68.0</version>
    </Package>
    ```

    Example directory:

    ```nolang
    myPackage/package.xml
    myPackage/restrictionRules
    myPackage/restrictionRules/Rule1.rule
    myPackage/restrictionRules/Rule2.rule
    
    ```

2.  Include all required fields. For more information, see the reference topic [RestrictionRule](https://developer.salesforce.com/docs/atlas.en-us.restriction_rules.meta/restriction_rules/meta_restrictionrule.htm).

    In this example, we used these values.

    ```nolang
    <?xml version="1.0" encoding="UTF-8"?>
    <RestrictionRule xmlns="http://soap.sforce.com/2006/04/metadata">
      <active>true</active>
      <description>Sales support associate sees only account records of specified advisor</description>
      <enforcementType>Scoping</enforcementType>
      <masterLabel>Advisor1 Record Type</masterLabel>
      <recordFilter>recordTypeId = '012xxxxxxxxxxxx'</recordFilter>
      <targetEntity>Account</targetEntity>
      <userCriteria>$User.ProfileId = '00exxxxxxxxxxxx'</userCriteria>
      <version>1</version>
    </RestrictionRule>
    ```

3.  Zip your directory, and deploy your changes. For more information, see [Deploying and Retrieving Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based.htm) in the Metadata API Developer Guide.


