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
prerak desaiprerak desai 

How do i get Package Version Number in Salesforce ?

Hey there ,
I stuck to get version number , i'd managed to get version name n all like 'XYZ..' but what i want is "V1.0 or 1.1 " like this
anybody there ???
PratikPratik (Salesforce Developers) 
Hi Prerak,

Go to Setup->Installed package

You will see the view as that of the below screenshot, there you will find version number for package.

User-added image

prerak desaiprerak desai
Hi Pratik
Thank you much but how do get this version by Apex code ?
rajesh k 10rajesh k 10
         I hope below link help to you
prerak desaiprerak desai
i've seen that example but can't through it , if you simplfied it in batter way then its been great !!
Hardik Chavda 37Hardik Chavda 37
If you want to get in apex, then you need to use tooling api rest call, but you can get the version number using SOQL query in developer console. 
Go to dev console --> query editor --> check the using tooling api. Search for the following query.

Select Id,SubscriberPackage.Name,SubscriberPackageVersion.MajorVersion,SubscriberPackageVersion.MinorVersion,SubscriberPackageVersion.PatchVersion from InstalledSubscriberPackage

Your package version number is majorversion+minorversion+patchversion.