Friday, September 19, 2014

Sharing Parent/Child Accounts with a Single Sharing Rule

I received a request to temporarily share the child accounts under a single parent account with a second rep so he and the owner could work as a team to do a blitz on the schools within a single school district.

The parent school district had almost 300 child school sites below it which needed to be shared fast, and un-shared just as quickly once the blitz was finished.

Unfortunately, Salesforce doesn't allow sharing child accounts under a parent using a single sharing rule with Parent Account Id as the criteria. And since I didn't want to spend my entire day updating these accounts with Account Teams, I had to find a different approach because the second rep needed account access within the hour.

My solution was to add a text field on the Account object that I could load the parent account Id into, and create a criteria based sharing rule on -- kind of a faux Parent Account Id field.

Parent Account Share

Before getting to the down-and-dirty, there's a couple of gotcha's to keep in mind. Criteria based sharing rules are only available in Personal, Enterprise and Unlimited editions. This will not work for any edition below that. And since you only have 50 criteria based sharing rules available, you should use this technique sparingly.

With that out of the way, here's how I made it happen.


  1. First, I created a new "Parent Account Share" text field on the Account object, setting field security viewable by all, editable only by the Admin. I didn't add it to any page layouts.

  2. Then, I found all accounts under the parent by creating a report using the Parent Account Id as my filter, with only the Account Id and Parent Account Id columns on the report layout, and exported it in CSV format.

  3. In the exported file, I changed the "Parent Account Id" column name to "Parent Account Share" and removed all the extra report fluff at the end of the file (don't forget to do that).

  4. Using DataLoader, I updated the accounts, matching column names.

  5. Next, I created a Public Group and added both the primary and secondary rep to it. I could have gotten away with just the secondary rep, but I like to have both users in the group so I know who's sharing together.

  6. Finally, I created new criteria based sharing rule on the Account object where "Parent Account Share" equals the Id of the parent account I just inserted into the "Parent Account Share" field, sharing it with the group I created, providing the level of Account, Contact, Opportunity & Case access as needed (Read/Write, Read/Write, Private, Private). I also named the group and sharing rule similarly so I know what goes with what.

  7. To make sure it worked, I logged in as the second rep to view the child accounts.



So there you have it, a quick way for sharing parent/child accounts when there are an outrageous number of children under a single parent.

No comments:

Post a Comment