Now it’s time to think about row-level security. How will you restrict access to each record in this dataset?
Required Editions
| Available in Salesforce Classic and Lightning Experience. |
| Available with CRM Analytics, which is available for an extra cost in Enterprise, Performance, and Unlimited Editions. Also available in Developer Edition. |
You decide to implement the following predicate on the dataset.
'UserId' == "$User.Id"
This predicate compares the UserId column in the dataset against the ID of the user running a query against the dataset. The UserId column in the dataset contains the user ID of the team member associated with each opportunity. To determine the ID of the user running the query, CRM Analytics looks up the ID of the user making the query in the User object.
For each match, CRM Analytics returns the record to the user.