0

Apparently I've made a long time assumption about Sharing Rules that may not be true.


Sharing Rules Based On User-Record Markers

If I have a Checkbox on the User record called "Allowed To See XYZ", and I have Accounts with a Checkbox marker called "XYZ", can I not create a Sharing Rule to allow USERS with that marker to see those ACCOUNTS? All I am (now) seeing is that we can use is Groups, Roles and Roles+Subordinates).

We have a need to allow users to see certain Accounts that have one or more of five different markers. If the USER record for the person logged on has any of the markers, they are to be able to see those Accounts that have the same markers.

  • Some users will have ONE marker and need to see records with that ONE marker
  • Some users will have THREE markers and need to see records with ANY ONE of those three markers

Account has markers (assume checkboxes): - Marker1 - Marker2 - Marker3 - Marker4 - Marker5

Users will have the exact same markers.

I had believed I'd be writing a formula for the criteria along the lines of (assuming checkboxes):

  • ( User.Marker1 & Account.Marker1 )
  • or if you prefer: if( User.Marker1 & Account.Marker1 ), TRUE, FALSE )

I'm starting to come up with an idea to work around this, but I really don't like it (using the User markers to automatically put them into Groups, then use the Groups to share). If that's the solution, so be it... I just don't want that complexity and maintenance of more routines.

Help.

1

I think that this can be solved by doing the following:

  1. Create a Public Group.
  2. Create a CheckBox on the Account with name:"XYZ"
  3. Create the same CheckBox on the User page layout.
  4. Create a Sharing Rule on Account based on criteria. Criteria is 'checkBox(XYZ) equals true'. Now assign the account to the public group created in point one.
  5. Write a trigger on the User object to make sure you add users with CheckBox(XYZ=True) to the correct group.

A second, or even a first one, option could be to use a Process Builder to do the same operation, but you need to have points 1 - 4 in place anyway.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.