4

When attempting to update our managed package in a subscriber org the install is failing with the following message:

Opportunities Missing Organization Feature: Opportunity.Sharing

That makes sense, as during packaging Opportunity Sharing is forced on as an Object Requirement.

enter image description here

I'm not 100% certain why that is forced on currently. I suspect it is related to explicitly referencing Organization.DefaultOpportunityAccess in the test cases. The presence of explicit references to OpportunityShare in the test cases is what is forcing the setting on.

What isn't clear is what sharing settings are required in the subscriber org to meet the Organization.Sharing feature requirement?

They currently have the Sharing Settings Organization-Wide Defaults set to Public Read/Write for both Default Internal Access and Default External Access. Or is the problem related to the specific Opportunity Sharing Rules?

1

If you reference a custom object’s sharing object (such as MyCustomObject__share) in Apex, you add a sharing model dependency to your package. Set the default org-wide access level for the custom object to Private so other orgs can install your package successfully.

from Special Behavior of Components in Packages

So, if I understand correctly it should be set the default org-wide access level for the Opportunity to Private in the Salesforce org which you use for publishing package.

  • 1
    Setting the Opportunity Organization-Wide Defaults to private rather than "Public Read/Write" did resolve the installation issue. I've opted to make the references to OpportunityShare dynamic in the test cases to remove the dependency. – Daniel Ballinger Jul 26 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.