You need to sign in to do that
Don't have an account?
sindhug
How can we get three part version number (major.minor.patch)of a managed package?
we have a managed package installed in our org.we want to get complete version of the package .we used version class
String version_nbr;
if(System.requestVersion().compareTo(new Version(1,0,0)) >= 0) {
String major=String.Valueof(System.requestVersion().major());
String minor=String.Valueof(System.requestVersion().minor());
String patch=String.Valueof(System.requestVersion().Patch());
if(patch==null)
version_nbr=major+'.'+minor;
system.debug(version_nbr);
else
version_nbr=major+'.'+minor+'.'+patch;
system.debug(version_nbr);
}
When i use this it is returning patch as null even the package version is 2.13.4
String version_nbr;
if(System.requestVersion().compareTo(new Version(1,0,0)) >= 0) {
String major=String.Valueof(System.requestVersion().major());
String minor=String.Valueof(System.requestVersion().minor());
String patch=String.Valueof(System.requestVersion().Patch());
if(patch==null)
version_nbr=major+'.'+minor;
system.debug(version_nbr);
else
version_nbr=major+'.'+minor+'.'+patch;
system.debug(version_nbr);
}
When i use this it is returning patch as null even the package version is 2.13.4
May I suggest you please check with below links which might help you further.
- https://help.salesforce.com/articleView?id=dev_package_versions_overview.htm&type=0
- https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_version.htm
Hope this helps.Thanks,
Nagendra
I am going in the same way as i gave in the code but it returns 2.13 only.Any reasons behind this?