Skip to main content
vasu muni ha preguntado en #Apex
I am new to salesforce, I have some confussion with Apex managed sharing, where we can use exactly in real time?

Please clear my confussion..

Thanks in advance
8 respuestas
  1. 29 nov 2016, 17:41
    Hi Vasu,

    As we know, we have different ways of sharing a record in Salesforce. One of the ways is Apex Managed Sharing which is a bit adavanced compared to others and has to be builit programmatically through Apex or Soap API.

    Apex managed sharing provides developers with the ability to support an application’s particular sharing requirements programmatically through Apex or the SOAP API. This type of sharing is similar to Force.com managed sharing. Only users with “Modify All Data” permission can add or change Apex managed sharing on a record. Apex managed sharing is maintained across record owner changes.

    Basically, if you want to share a record programmatically we use Apex Managed Sharing.

    For example, AccountShare is the sharing object for the Account object, ContactShare is the sharing object for the Contact object, and so on. In addition, all custom object sharing objects are named as follows, where MyCustomObject is the name of the custom object:

    MyCustomObject__Share

    You can find more details in Salesforce Documentation which can be accessed via below link.

    https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm

    If this answer helps you, do not forget to mark it as Best Answer.

    Thanks

    Brahma