function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hardik Chavda 37Hardik Chavda 37 

Need to get all installed package version only by using SOQL query, Is there any way?

Is there any way that I can get installed package version using SOQL query?
Best Answer chosen by Hardik Chavda 37
Deepali KulshresthaDeepali Kulshrestha
Hi Hardik,

No this cannot be done via SOQL. Using JSForce, you can do a Metadata Retrieve requesting the following members

conn.metadata.retrieve({
    apiVersion: '39.0',
    singlePackage: true,
    unpackaged: {
      types: [{
        'members': ['*'],
        'name': 'InstalledPackage'
      }]
    }
  })

The response would return all installed packages and and an attribute for their versionNumber
 

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com