Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Allow Users to See Only Records Owned by Same Role

This restriction rule allows active users to see only the events owned by users that have the same role. You can use dot notation to traverse object and field relationships in the recordFilter field.

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

Tooling API

1{
2    "FullName":"restictionruleeventsrole",
3    "Metadata": {
4        "active":true,
5        "description":"Allows active users to see only events owned by users of the same role.",
6        "enforcementType":"Restrict",
7        "masterLabel":"Events Owned by Same Role",
8        "recordFilter": "Owner:User.UserRoleId = $User.UserRoleId",
9        "targetEntity":"Event",
10        "userCriteria":"$User.IsActive = true",
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 active users to see only events owned by users of the same role.</description>
5    <enforcementType>Restrict</enforcementType>
6    <masterLabel>Events Owned by Same Role</masterLabel>
7    <recordFilter>Owner:User.UserRoleId = $User.UserRoleId</recordFilter>
8    <targetEntity>Event</targetEntity>
9    <userCriteria>$User.IsActive = true</userCriteria>
10    <version>1</version>
11</RestrictionRule>