Skip to main content

Hi there,

 

Just wondering if its possible to have a sharing setting on a custom object for a UserID?  to give some background:

 

I have a private custom object called "Commission Table", associated to an Opportunity.  The object calculates the commission the Sales user should receive based on user profile values.

 

The issue is that there can also be a Secondary Sales User.  There is a lookup to User records on the Commission Table (called Secondary User).  I want the owner of the record, and the secondary user to only have access to these records.

 

So is it possible to have it as private, and have a sharing rule that allows a user to view the record if Secondary User ID = Current User ID?

 

 

Thanks

3 个回答
  1. 2016年2月3日 02:11
    Hi Wes,

     

    You can create a criteria based sharing rule and use the lookup ID in the criteria, but you have to specify the ID's, it can't be set to reference "running user ID."   Here's an idea for that:  https://success.salesforce.com/ideaView?id=08730000000hDvDAAU

     

    If you want to go the apex code route, here's some info on that:  https://developer.salesforce.com/page/Using_Apex_Managed_Sharing_to_Create_Custom_Record_Sharing_Logic

     

    Unfortunately, this is all I got for a non-code solution that doesn't expand sharing to more than just the person in the secondary owner field:  Snce the record owner has the ability to manually share the record to anyone, you could come up with a process that prompts/reminds the owner to share with the secondary user. 

     

    I'm sure others will chime in with potentially better solutions for you
0/9000