1

I need to create a patch release of one of our managed packages and have created the patch org. But that patch org did not include the two managed packages present in the normal packaging org and when I tried to add them I got this message:

The AppExchange is not enabled for your organization. Contact salesforce.com to enable it.

(Objects from the two managed packages are accessed via dynamic SOQL in this third managed package, hence the need to have them present to test. The dependency is run-time not compile-time.)

I have contacted Salesforce support, and so far the response is that managed packages cannot be added to a patch org. So testing patches with this sort of dependency looks especially awkward. So creating patches with this sort of dependency is impossible (as the tests have to pass when a version is uploaded).

Has anyone else hit this problem? Workarounds?

3

I went through this same thing when the packages were referenced dynamically in the main package.

Unfortunately there is no work around and attempts to get Salesforce to allow it were futile for me

Their response was that a managed package is considered an add so it was not allowed.

I was stuck with either forcing a hard reference to the packages thus requiring them in destination orgs, completely restructuring the tests, or never creating a patch.

I went with the latter

As for the test workaround, it would be a hack but I thought about creating a custom metadata type to mimic the behavior of the object I needed so I could test it but there was too much functionality around the object in question that it was not feasible.

If it would be helpful I can dig up the case and paste the response

  • Thanks Eric. Support's suggestion was to push the code for testing into an additional org - unwieldy to say the least but as I have a branch for the patch it is something I probably can do. Just more hours wasted. – Keith C Feb 17 '17 at 14:43
  • @KeithC - not sure I understand. Are you saying create a separate org for the tests around that piece? If so how would that help your main package meet test requirements? Or is that org just for those dynamic tests and never packaged and is there just for the validation of the code for that part of the package – Eric Feb 17 '17 at 14:49
  • Eeeeek hadn't thought that through. I was thinking about manual testing not the test runs done during the package upload. There are hundreds of tests that require the other managed packages. So you are right - looks like patches can't be created for this sort of managed package. – Keith C Feb 17 '17 at 14:53
  • I have high hopes that DX will solve all of this lol....They have said that existing packages can transition to DX without issue, I hope so but I have my doubts and for sure will not be one of the first to do the transition :0 – Eric Feb 17 '17 at 14:56

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.