+ Start a Discussion

Sharing rules for custom objects


My company has implemented sf.com with the private sharing model for standard products.

I have imported invoice headers and invoice items from our order management
system into custom objects in sf.com so sales reps can see what orders
have shipped and how they are going vs quota. The owner of the invoice
header custom object is the same as the account record owner and the
invoice item custom object is a detail off the header master.
In some cases accounts need to be shared among users, so I use the sharing rules
to define groups of users that share common accounts. The problem is
that custom objects cannot be configured using similar sharing rules
as far as I can tell. Is there a way to make individual custom objects
that are set up in a global private model sharable between users?

You'd probably get a better answer on the CRMSuccess boards, but off the top of my head, custom objects that have M/D relationships to standard objects should use the sharing of the parent object. so if Account 1 is viewable via sharing between User1 & User2, then the child custom objects of Account 1 are also viewable via User1 & User2.
The problem is that the invoice header isn't really a child object of the
Account. It is the Master and the invoice items are the Detail. Ideally,
the header would be the child of the account, but a master can only have one
detail, so I can't do Account (master)->Invoice Header (detail)->Invoice Item (detail). Instead I set up
the Account as a custom field of the invoice header so it just refers back to the account.

90% of the time I only want the invoice header viewable by the account owner, so I set the
ownership of the header to be the owner of the account and use a private sharing
model for the account records. However, in some
situations I want User 1 and User 2's to share invoice headers and Account records. i.e. viewable to both. Using the account sharing rules from the setup->Security Controls->Sharing rules gets me half way there, but there isn't an option to configure sharing rules for custom objects.

I think the problem you're running into is that no custom object can be a master in one relationship and a detail in another relationship. Clearly, this is poses a major limitation in representing even fairly simple models in salesforce, such as yours. You could create another custom object with lookup relationships to the account and invoice header. It's not terribly elegant, but may do the trick for you. I'd be interested in hearing other solutions that anyone may have.

Thanks for the info.

BTW, I should clarify... The first sentence in the first message of this thread should read:
"My company has implemented sf.com with the private sharing model for standard OBJECTS."

The master-detail relationship for invoice header->invoice item would work okay if we had sharing
rules for custom objects like there are for standard objects.
For the time being I think I'm going to move one sales rep up the role hierarchy
to give them access to the other user's data (and everyone elses!). What can you do...

I suppose the other thing I could do is combine the Invoice Header and Invoice Item objects into
one and make it a detail-type record off the Account (as master).
This would probably let me set the ownership of the object to be that of the parent (account).
Unfortunately this means rewriting a lot of reports, dashboards, and custom interface code.

ease of use / flexibility. Trade-offs...
If you want sharing rules on custom objects, please log a feature request. We don't support sharing rules on custom objects yet today, but you can do some fairly powerful things using the master-detail relationships

I've had a similar problem with a "two level hierarchy" ... in my case, 

    Account  --> License --> Licensed Product
  and also
    Account  --> License --> Machine

My kludge: by re-purposing the standard Asset object (hiding standard fields, adding new ones), I can use it for the License information in place of a custom object. Then the Licensed Product and Machines custom objects can be children of License.

If you had one of the standard objects you're willing to use this way, you might get the cascading ownership from the accounts ...