Allow Users to See an External Object's Records

This restriction rule allows active Salesforce users to see the records of an external object called Purchase Order. The rule uses a field called IsClosed on Purchase Order records in its record criteria.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Available in: Lightning Experience in Enterprise, Performance, Unlimited, and Developer Editions

Only external objects created using the Salesforce Connect: OData 2.0, OData 4.0, and Cross-Org adapters support restriction rules. Find out more in Restriction Rule Considerations.

Note

Tooling API

1{
2    "FullName":"purchase_orders_restictionrule",
3    "Metadata": {
4        "active":true,
5        "description":"Allows accounting department users to access open purchase order records from external system.",
6        "enforcementType":"Restrict",
7        "masterLabel":"OpenPurchaseOrderRecords",
8        "recordFilter":"IsClosed__c = ‘false’",
9        "targetEntity":"PurchaseOrder__x",
10        "userCriteria":"$User.Department = ‘Accounting’",
11        "version":1
12    }
13}

Metadata API

1<?xml version="1.0" encoding="UTF-8"?>
2<RestrictionRule xmlns="http://soap.sforce.com/2006/04/metadata">
3    <active>true</active>
4    <description>Allows accounting department users to access open purchase order records from external system.</description>
5    <enforcementType>Restrict</enforcementType>
6    <masterLabel>OpenPurchaseOrderRecords</masterLabel>
7    <recordFilter>IsClosed__c = ‘false’</recordFilter>
8    <targetEntity>PurchaseOrder__x</targetEntity>
9    <userCriteria>$User.Department = ‘Accounting’</userCriteria>
10    <version>1</version>
11</RestrictionRule>