I have complex requirement where I need to use Apex sharing for both standard & custom object. Share Object and its fields are different for Standard and Custom Obect.
For example,
for Lead, its share object is LeadShare (fields: LeadAccessLevel, LeadId ...)
for Custom__c, its share object is Custom__Share (fields: AccessLevel, ParentId...)
Trying to make this dynamic in nature. and So I need to find equivalent Share object for given object, Is there any way to get this ? Like using Schema or something else
Thanks & Regards
Sumeet Negi (Eptura) Forum Ambassador
Hi @Piyush Lakhani So all the standard objects will have the name of their sharing object as the standard object api suffixed with the keyword share.
Example- AccountShare, OpportunityShare
All the custom object will always have the keyword share suffixed by the Share keyword.
Example- CustomObject1__Share, CusObj__Share