How to get the license information in classic code?

Less than one minute read time.

Prior to V7 you could use ver$ to get some information like the serial number in 4GL code.(similar to below)



But starting with V7 and changes in license system in Enterprise management, now license is stored in MongoDb, so how would you go about writing code to check the license for example serial number.

This is possible thanks to methods already developed for license retrieval. 

Before we get to the example review the online help for the list of these methods by searching for "License"

   

So here is the example how you would use these methods in Classic code, of course in V7 style code I could instantiate the license class, but in classic code thanks to existing contexts you can use below:



So in the actual code it would be something like below:

Local Char ZSERIAL(30)

ZSERIAL = fmet GACTX.AGETLIC_SERIAL("1")

Conclusion: You can use methods like AGETLIC_SERIAL to get the serial number of your installed license.

  • Hello Ali, I would like to ask if it possible to extract the License information from X3 V11 in a file that has the json format. I am making a new installation for a client and it seems they didn't received the license file in as a file for self keeping but it was installed for them. I just need the answer for this and it if it possible the steps to do it. I can't find this information on the KBs, Thanks