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
Shmuel KamenskyShmuel Kamensky 

Is the OpportunityShare.RowCause available for changes through the API?

According to the documentation on OpportunityShare about RowCause:

"You can create a value for this field in API versions 32.0 and later with the correct organization-wide sharing settings."

However, according to the fore.com developer guide (p. 187 as of the time of this post)

"Apex Sharing reasons and apex managed sharing recalculation are only available for custom objects."

I can't find a way to edit it via the UI and tried retrieving the picklist value from workbench but I got back an empty manifest (just the project.xml file I used to retrieve it).
Is this possible, or is this a Salesforce documentation error?
NagendraNagendra (Salesforce Developers) 
Hi Shmuel,

It's just tricky wording.

Create - "When creating a record" - not create your own value.
When creating an OpportunityShare or modifying an OpportunityShare where the RowCause is not set you can set the value to:


Valid values include:
  • Owner—User is the owner of the opportunity.
  • Manual—User or group has access because a user with “All” access manually shared the opportunity with the user or group.
  • Rule—User or group has access via an opportunity sharing rule.
  • ImplicitChild—User or group has access to the opportunity on the account associated with this opportunity.
  • Sales Team—User has access to the opportunity because the user is on the opportunity sales team for the opportunity. The OpportunityTeamMember object sets the access level. See OpportunityTeamMember for more information.
However, you CANNOT create your own custom sharing reason values to set the row cause to.
Hence the Apex Sharing reasons only being available for custom objects.

Also, OpportunityShare is only available to query via the UI if the OWD for the Opportunity are NOT set to public read / write. If the OWD is set to public read / write then you will get a query error
User-added image

Please mark this thread as solved if it's resolved so that experts from the community will be no longer replying to this thread.Which results in helping others.

Best Regards,
Nagendra.P