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

OpportunityAccessLevel - 'None' Error




I am trying to set the Opportunity access via the OpportunityShare object. I  have set the OpportunityAccessLevel to 'None' for one of the members in the team.

I get the error:

INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Opportunity Access: bad value for restricted picklist field: None: [OpportunityAccessLevel]


Is it not possible to set the access level to 'None' at all??



You can only set "none" on accountshare's opportunityaccesslevel. The only legal values are "Read", "Edit", or "All" for OpportunityShare's OpportunityAccessLevel (and "All" can't be used directly, it's a system-defined value). You should check out the SOAP API docs for more details, but basically you should know that you can never revoke access through a share table (that would be the use of "none"). Access is always cumulatively granted, and the system won't allow ineffective sharing to be stored, so a "do-nothing" entry of "none" in OpportunityShare would simply be wasting space. To deny a user access to a record, you must ensure that no other rules grant read access or higher. This may take significant work, depending on your organization's hierarchy. I'd recommend reaching out to support if you really need to configure your securit y. Alternatively, you can globally restrict the user by making a profile without opportunity access.