1

I'm querying the tooling API via some external C# code to get a list of installed packages.

SELECT SubscriberPackage.Name, SubscriberPackage.NamespacePrefix, SubscriberPackageVersionId FROM InstalledSubscriberPackage

On some orgs, I get the error INVALID_TYPE: sObject type 'InstalledSubscriberPackage' is not supported.

How do I make the InstalledSubscriberPackage object available?

I'm not sure what the differentiating factor is for whether InstalledSubscriberPackage exists.

I've ran the query successfully against:

  • non-DevHub orgs
  • DevHub orgs
  • developer orgs
  • sandbox orgs
  • scratch orgs

I suspect that there's a setting I need to enable or permission I need to grant to make the InstalledSubscriberPackage object available, but I can't find what.

  • What details do you have about the orgs where it isn't available? Are they scratch orgs? Are they sandboxes? Are you using the Developer Console to run the Tooling API query? Are you running the query as part of a managed package? – Daniel Ballinger Oct 27 at 8:19
  • @DanielBallinger I've updated the question to answer those, but in summary: I'm running the query in some external C# code, so not a manged package. The query has worked against scratch orgs, sandbox orgs and dev orgs, so I don't think that's the factor causing InstalledSubscriberPackage to exist or not exist. – Tom Oct 28 at 9:30
  • I'd start by checking the permissions related to managing packages. Try "Download AppExchange Packages" and maybe "Manage Package Licenses". Can you manually access the list of installed packages via the UI? - View Installed Package Details – Daniel Ballinger Oct 28 at 20:22
  • Thanks @DanielBallinger, it's the Download AppExchange Packages permission I need for this query to work. – Tom Oct 30 at 9:41
1

The user needs to have the Download AppExchange Packages permission in their profile.

Download AppExchange Packages permission

If they have the permission, the query on the tooling API returns records from InstalledSubscriberPackage.

SELECT SubscriberPackage.Name, SubscriberPackage.NamespacePrefix, SubscriberPackageVersionId FROM InstalledSubscriberPackage

If the user does not have the permission, they'll get the error

INVALID_TYPE: sObject type 'InstalledSubscriberPackage' is not supported

Credit to @DanielBallinger for pointing me in the right direction here.

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.