Greetings people
The thing I am trying to accomplish, is that I have added to the Application globals some features that exist in a module (let's call it MyModule), and I need them to have values on startup by acquiring them from the database. Let's also assume that the Application globals part of MyModule is called Utils (hence a $MyModule.Utils.XXXXX is visible anywhere)
In order to do that I need to get a CAPICONNECT or a PrgCtx. I opted for the second solution and I used the following code, inside MyModule::MyModuleRoot::Startup method:
Dynamic prgCtx = $DBWIZAPI.DBWizApiSubsystem.SetUpWizData().GetPrgCtx().prgCtx
$MyModule.Utils.fTestPrgCtx = prgCtx
Dynamic results = CAPI.Exec(prgCtx.fDbConnect.fConnection, "SELECT SYSDATE FROM DUAL") // NOT THE ACTUAL QUERY OFC
$MyModule.Utils.fTestDatabaseResults = results
So at this point this code should run on startup but unfortunately, when the server is loaded, I use a script to echo the values of $MyModule.Utils.fTestDatabaseResults and I get undefined.
Any chance to acquire database connectivity on startup? Or is there a global Startup object on 10.5 that runs after everything is loaded and dftConnection is established so that I can plug my startup config code in it (Something that I would personally like to avoid because I want my code to reside inside my modules).
Thank you very much in advance