To Share or Not to Share – Part 3

Part 3 – Sharing Rules

So far, we’ve learned how to configure the base level of access to records using the Organization-Wide Defaults (OWD), and then opened up vertical access through the Role Hierarchy. Now we will review how to open horizontal access using Sharing Rules.

In our daily lives, we are surrounded by sharing rules. They come in many forms: sometimes we need to share something with a specific person (like when your mom tells you to share a toy with your brother); other times we need to share several things with a group of people (like equipment at the gym). These two examples also apply to our CRM lives, in what I will call peer sharing. Peer sharing is when you need to share records you can access with someone that is at the same level or above you in the Role Hierarchy, or with someone who has no direct relationship to you at all.

Consider the following scenario:

We can easily identify the siblings of the “VP, Marketing” Role. (Be sure to brush up on your skills here with our “3 Golden Rules” Quiz). We know by default that siblings are not able to see each other’s records. In order to boost marketing and create content specific campaigns, the “VP, Marketing” Role should have access to its siblings’ Opportunity records.

Role Hierarchy vs. Sharing Rules

To achieve this, someone with elementary experience in Salesforce might envision restructuring the Role Hierarchy to look like this diagram. The problem with this approach is that you not only give access to the Opportunity records, but also to every record in the Org (Accounts, Contacts, Cases, custom Objects, etc).

Instead, implementing a Sharing Rule will meet this business requirement and preserve our data security model.

5 Items You Should Know about Sharing Rules

  1. You can create them on most Standard and ALL custom Objects.
  2. They are triggered automatically; no user interaction needs to take place.
  3. They are applied retroactively to records, meaning they apply to existing records as well as new ones.
  4. You do not need to have a Role Hierarchy in place to use Sharing Rules.
  5. Sharing Rules can be based on record ownership or when specific criteria are met.

Let’s Make it Happen

Here are the steps to create a Sharing Rule:

  1. From the Setup Menu, type “Sharing” in the quick Find,
  2. Click on the Sharing Settings item below Security Controls,
  3. In the “Manage sharing settings for” dropdown, select the object for which you would like  to create the rule. In this case, we chose “Opportunities”.
  4. Click New on the Opportunity Sharing Rules related list.
  5. Take the time to give your Rule a descriptive Label and Name. As your sharing model grows in complexity, it’s easy to forget why each Rule was implemented in the first place.
    1. A best practice is to follow a naming convention for all your rule names. My naming convention is: WhoHasAccess_Shares_WhoShouldSeeIt. In the example above, the full Label is “VP International Shares VP Marketing”.
    2. Also, remember to include the reason why this rule exists in the Description box. This will come in handy once your sharing model starts to grow and build in complexity.
  6. Select the type of Sharing Rule you want to create:
    1. Based on Record Owner: gives you the ability to select a Role and its subordinates or a Public Group.
    2. Based on Criteria: gives you the flexibility to choose specific criteria to be met in order to share the record.  This is really helpful in a one-to-many sharing scenario, i.e., if you need to share only Joe Smith’s Opportunity records with the Account team.
  7. The next two steps go hand-in-hand. This is where you select who-has-access with who-should-see-it (see Step 5a). In our scenario, we want to share records owned by “VP, International Sales” with “VP, Marketing”.
  8. Finally, choose the level of access the WhoShouldSeeIt will have to the shared records – in our scenario this is “read-only” – and click Save.

Click Ok on the alert message; and you’re done!

But Wait! There is Homework

We just configured the first part in our sharing path — the solid blue line in the image. Now you need to configure the second part:

Sharing the records owned by “VP, North American and its children” with the “VP,  Marketing”

Homework Solution:

In our final post of this series, we will review how to hand pick who to share your records with using Manual Sharing.



About the Author

Clara Perez is a Salesforce MVP and Lead Developer at Great Wave who loves teaching Salesforce concepts.