2

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.

4
  • 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? Commented Oct 27, 2019 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
    Commented Oct 28, 2019 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 Commented Oct 28, 2019 at 20:22
  • Thanks @DanielBallinger, it's the Download AppExchange Packages permission I need for this query to work.
    – Tom
    Commented Oct 30, 2019 at 9:41

1 Answer 1

4

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .