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
ywangywang 

Can I delete OpportunityShare objects using API?

The value "None" is included in the picklist of "OpportunityAccessLevel". But I failed in trying to delele a manually set OpportunityShare object  by AJAX API.
the erroe means that "None" is an invalid value for OpportunityAccessLevel.
 
The source code is as following.
 
      var contact = new Sforce.Dynabean("OpportunityShare");
      contact.set("ID","00t10000001TvMi");
      contact.set("OpportunityAccessLevel","None");
      contact.set("UserOrGroupID","00510000000LjoT");
      var saveResult = sforceClient.update([contact]);
By the way, the action of create succeeded.
 
Look forward for any advice.