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
SF Buzz VutukuriSF Buzz Vutukuri 

How to get version number of package

We got a requirement, need to get the version number of a installed package from PHP side so that we can maintain dffrnt folders from each version in PHP.
please help me in getting version number of installed package from the side of PHP through API
Gaurav NirwalGaurav Nirwal
This isn't necessarily the answer you're looking for, but one way to do this could be to just have a static string member variable in a class which becomes part of your package. Each time you update the package you could update the value of the string and then read that from wherever else you need to.

// the class
class CVersionTracker
  public static string version = "1.0";

// inside a method of some other class
if (CVersionTracker.version == "1.0")
    // take some action
    // take the new improved action!
Depending on your requirements for the version number of course, an integer or double might be the simpler option (though it maybe not reflect the actual version) as it would let you leverage the > and < operators.
SF Buzz VutukuriSF Buzz Vutukuri
Hi Matthews,

Thanks for your solution.

How to access that class from Other Technology like Java or PHP.

can we use MetaData??


can we implement  that class as SOAP or REST custom Service class