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
Caleb_SidelCaleb_Sidel 

Apex Managed Sharing not working as documented - help!

Page 143 of the Apex Guide states

 

All Apex sharing reason names have the following format:

MyReasonName__c

Apex sharing reasons can be referenced programmatically as follows:

Schema.CustomObject__Share.rowCause.SharingReason__c

For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:

Schema.Job__Share.rowCause.Requester__c

 

 

however when I try to save my code I get the error that the variable doesn't exist. If I try Schema.CustomObject__Share.rowCause.Manual I also get an error.

 

So it seems that that Schema is not where rowCauses are stored and/or I'm missing something. Has anyone successfully used custom rowCauses? If so what's the format?

 

Thank you,

Caleb

Best Answer chosen by Admin (Salesforce Developers) 
Caleb_SidelCaleb_Sidel

Nevermind, typo! Commissions with an S not Commission.

 

Thanks,

Caleb