Is there a way to get the current build version number to display on the landing pages.

3
Hi There We have many branch Lines and it would help us if we could show the current build version number on our landing pages. Regards, Patrick
asked
4 answers
3

Note, I have not tested this in the licensed cloud nor did I test this on the most recent version.

There is an (undocumented/unsupported) function to get meta information about the platform. On my local environment I ran the following function which returned "unversioned" as expected, On my sandbox this function returned: "1.0.0.45" as the version nr. I did deploy commit 45 to the sandbox when I tested.
The about shows the same information as what Kilian is referring too.

Core.getComponent().runtime().about().get("model_version")


The function Core.getComponent().runtime().about() returns a java.util.Map with the following values:

{name=Mendix Runtime, 
 vendor=Mendix, 
 copyright=Copyright © 2003-2016 Mendix bv. All rights reserved., 
 xasid=d66bd3e8-6274-42f9-a8aa-996e4e8155a6, 
 version=6.3.1, 
 build=7603, 
 model_version=unversioned
}



Again, I have not tested what the value is in the licensed cloud and since this isn't a documented or supported api this may or may not work in the latest version. But it might be worth exploring. But I'm expecting that this is the same information as what is being published through the 'about' monitoring operation.

answered
0

You could get it from the metadata.json file located in the deployment\model folder.

  "RuntimeVersion": "6.6.0",
  "ProjectID": "YOUR_PROJECT_ID",
  "ProjectName": "YOUR_PROJECT_NAMEr",
  "ModelVersion": "unversioned",
  "Description": "",
  "AdminUser": "MxAdmin",

The ModelVersion attribute contains the version number of your application if the deployment package was created as a versioned deployment.

Note however that as far as i know without exceptions you are not allowed to read this file when you run in the Mendix Cloud.

answered
0

There's now an even simpler solution: Core.getModelVersion();

This returns 'unversioned' locally, but the correct 1.2.0.2014 in my Test environment.

answered
-2

As far as I am aware, this answer is still valid.

answered