QuestionQ22

Security

Universal Containers (UC) is deploying CRM Analytics to its field sales organization, including dashboards that contain order data from an external source. UC has a clearly defined role hierarchy, with every user assigned to the appropriate node in the hierarchy. The order data also references a Salesforce opportunity.

An individual sales rep must be able to see every order they own or can access as an account-team or opportunity-team member. The sales manager must be able to see all orders for the full sales team. Likewise, the VP of Sales must be able to see orders for everyone who reports up through that hierarchy.

The dataset contains a field named OwnerId that identifies the order owner.

Given this information, how should a CRM Analytics consultant implement these requirements?

  • A As part of the recipe, use a formula on the RoleId field to create an attribute called ‘ParentRoleIDs’ on the dataset, and apply the following security predicate: ‘ParentRoleIDs’ = = “$User.UserRoleId” | | ‘OwnerId’ = = “$User.Id”.
  • B As part of the recipe, use a multi row formula on the RoleId field to create an attribute called ‘ParentRoleIDs” on the dataset, and apply the following security predicate: ‘ParentRoleIDs’ = = “$User.UserRoleId” | | ‘OwnerId’ = = “$User.Id”.
  • C As part of the recipe, use the flatten operation on the role hierarchy, create a multi-value attribute called ‘ParentRoleIDs’ on the dataset, and apply the following security predicate: ‘ParentRoleIDs’ = = “$User.UserRoleId” | | ‘TeamMember.Id’ = = “$User.Id” | | ‘OwnerId’ = = “$User.Id”.
Explanation

Flattening the Salesforce role hierarchy creates a multivalue attribute containing each record owner’s ancestor role IDs, allowing a security predicate to grant managers and VPs visibility when their $User.UserRoleId appears in that attribute. The predicate must also grant access to the order owner and to users represented by TeamMember.Id, so it covers ownership plus account-team and opportunity-team membership. Salesforce documents the Flatten transformation specifically for role-hierarchy row-level security and supports multivalue fields in security predicates.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!