2

Hey versioning experts,

Has anyone used Apex to construct a semantic version bumper?

Im looking to implement an Apex-driven "versioning" concept to a custom app, functioning somewhat similar to versioning forms/validations in SFDC Packaging, but specific to salesforce Records, not Packages.

The idea is that records would have semantic versions like packages but stored in a custom text field, "SemVersion__c".
The user would be allowed to increment it using semantic versioning standards so that version strings are comparable (major minor patch qualifier etc.) and always-incrementing

Thanks for the collaboration!

1
  • 3
    I haven't explored using it against Apex records, but the native Version class could be really useful here. It will give you a container for you major, minor, and patch numbers. Plus a compareTo(version) method. Commented Nov 24, 2020 at 21:49

1 Answer 1

5

One option would be to use the native Version class that Apex provides.

This will give you major, minor, and patch numbers.

Plus there is an existing compareTo(version) method.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .