4

The Version class has methods to get the major, minor, and patch version numbers, but after getting the version using System.requestVersion(), patch() seems to always return null. Is there a way in Apex to get the patch number without going through all the hassle of the metadata API?

  • And you're doing this from within your managed package code? – sfdcfox Apr 13 '16 at 17:45
  • @sfdcfox That's right. – Neo Apr 13 '16 at 20:15
  • That's odd. Time to dig out my old fake managed project... – sfdcfox Apr 13 '16 at 20:19
  • Its documented to behave that way by design apparently. Seems pretty odd to me. If you ever found a solution I'd be interested to hear it. The value returned by the System.requestVersion method is an instance of this class with a two-part version number containing a major and a minor number. Since the System.requestVersion method doesn’t return a patch number, the patch number in the returned Version object is null. – Phil B Jun 25 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.