Pages

Monday, July 20, 2015

Salesforce: Sharing Button URL

We have discussed the Sharing button sometimes back in our blog Salesforce Sharing Button. The sharing button in Salesforce gives users the ability to grant access to other users more permissions to specific records.

But, on top of just giving additional access to other users, there is also a button called Expand List, which will show all users who have access to the record; Salesforce admin can use this functionality to trace record sharing access level and the reasons when need to support.

But, for some companies, users are not allowed to manually share record accessibility, so the admin or consultant who implemented Salesforce will take this button away; this will also cause the admin cannot use not this button to trace record sharing easily.

Options available:
  • Create a new page layout for admin with the Sharing button - this is not really nice as you need to maintain another page layout just for the sake of this need.
  • Manually add and remove the button when needed; this is easier, but if you have proper Change Management, this will cause issues as you do not have good reason to keep updating the page layout.

URL

Actually, when you click that button, salesforce will bring you to a URL. So, manually typing the URL parameters will give you the same functionality as clicking the Share button. 

Account
https://ap1.salesforce.com/p/share/AccSharingDetail?parentId=00190000007Gyno

Opportunity
https://ap1.salesforce.com/p/share/OppSharingDetail?parentId=0069000000aXoxH

Contact - not applicable for Controlled by Parent sharing setting
https://ap1.salesforce.com/p/share/ConSharingDetail?parentId=0039000000C26VC

Lead
https://ap1.salesforce.com/p/share/LeadSharingDetail?parentId=00Q90000003UQDa

Case
https://ap1.salesforce.com/p/share/CaseSharingDetail?parentId=5009000001vQyjk

Custom Object
https://ap1.salesforce.com/p/share/CustomObjectSharingDetail?parentId=a0J900000005pWa

Just change the instance name to your instance name, use the correct parameter based on the object, and put it in the Record Id; you will get the same result as clicking the Sharing button.

In Lightning

Lightning has a different URL, but you still can use the above URL to see the sharing.

Sharing Hierarchy
This is similar to the "Expand List" button in Classic. Use the "View" link to get a similar function to "Why" in Classic. 
https://domain.lightning.force.com/lightning/r/Opportunity/0062H00001JPFSHQA5/recordShareHierarchy

Share
From here, you can add sharing to a user, group, role, etc. Click the "Edit" link to see all the current shares for the record, then click "View Sharing Hierarchy" to get the above result.
https://domain.lightning.force.com/lightning/r/Opportunity/0062H00001JPFSHQA5/recordShare?backgroundContext=%2Flightning%2Fr%2FOpportunity%2F0062H00001JPFSHQA5%2Fview



Sharing from Role Hierarchy

Contact, Opportunity, and Case are special objects where we can set the Account owner's ability to view or edit  Contact, Opportunity, and Case that are related to the Account. This is configured in the role hierarchy of the Account Owner.


How does this translate when we use the above links with parameters to see access reason?


This is an opportunity, owned not by the Account Owner; the opportunity access in role hierarchy for the Account owner = Users in this role can view all opportunities associated with accounts that they own, regardless of who owns the opportunities.


This is the same opportunity as above, but opportunity access changed Users in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities.


The same access reason for Contact and Case too, with Reason for Access = Account Sharing.




No comments:

Post a Comment