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
Raza Hussain 2Raza Hussain 2 

System.requestVersion().patch() returns null instead of patch Version

Hi

I was trying to get the patch version and i have seen the salesforce doc for this purpose but it seems no matter what i do it will just return null instad of the patch version has anyone experience the similar problem or if anyone knows about this behaviour can they help me out please.

Thanks 

Leo10Leo10
Hi Raza,
patch() will return the patch package version of the calling code or null if there is no patch version.

Regards,
Leo
Raza Hussain 2Raza Hussain 2

Hi Leo,

Can you try that and give me some general directions becuase i have tried various different patches but it still returns me null everytime.

Thanks

Leo10Leo10
Hi Raza,
Did you try with
System.requestVersion().major()  
System.requestVersion().minor() 

               The version number has the format majorNumber.minorNumber.patchNumber (for example, 2.1.3). The major and minor numbers increase to a chosen value during every major release. The patchNumber is generated and updated only for a patch release.
Regards,
Nabeel
Raza Hussain 2Raza Hussain 2

Hi Nabeel 

So for example if i have a version as 4.567.89 and the System.requestVersion().minor() will return 567 and .major() will return 4 so if i use the patch() then it should return me 89 but it returns null. I was wondering why would it return null to me rather then 89.

Thanks
 

Leo10Leo10
Hi Raza,
Are you sure that there is a patch Number in it?
Regards,
Nabeel
Raza Hussain 2Raza Hussain 2

Hi Nabeel

Yes i am Sure of that have you tried it on your end.I mean have you run the code and did it return null or patch number.

Thanks