This was asked in 2015 - Querying Managed package version from Apex - (and in other posts here) but I want to check that there has been no change to this in the last 3 years.

We have several managed packages and want to introduce another small managed package (that cannot have compile-time dependency on the others) that contains links to a documentation server. The documentation is versioned there to match the managed package versions, so we would like to automatically discover the current version of all our managed packages. Then the correct links can be offered. An SObject we could query would be ideal...

How can these versions best be found using Apex code with these constraints?


Why not query InstalledSubscriberPackage using tooling API?

SELECT Id, SubscriberPackageId, SubscriberPackage.NamespacePrefix,
SubscriberPackage.Name, SubscriberPackageVersion.Id,
SubscriberPackageVersion.Name, SubscriberPackageVersion.MajorVersion,
FROM InstalledSubscriberPackage
ORDER BY SubscriberPackageId

SOQL to get Installed Package details


|improve this answer|||||
  • So no direct call from Apex available? The downside of the web service call is needing the remote site setting up (as well as more code). – Keith C May 21 '18 at 19:20
  • Yeah.. except Tooling couldn't find anything in Native Apex. – Pranay Jaiswal May 21 '18 at 19:51

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.