function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
priya bhawna shettypriya bhawna shetty 

apex sharing related

hi guys

pls tell me how to share a record by using apex sharing practically.

 

thanks

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hello,

 

Apex Managed SharingApex managed sharing provides developers with the ability to support an application’s particular sharing requirements pragmatically 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.

 

Ex: Suppose you wish to apply some complex condition before sharing a record which can not be achieved by sharing rule criteria then you will use apex sharing.

 

All Answers

Vinita_SFDCVinita_SFDC

Hello,

 

Apex Managed SharingApex managed sharing provides developers with the ability to support an application’s particular sharing requirements pragmatically 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.

 

Ex: Suppose you wish to apply some complex condition before sharing a record which can not be achieved by sharing rule criteria then you will use apex sharing.

 

This was selected as the best answer
priya bhawna shettypriya bhawna shetty

Thanks a lot ......