Is there a class method that runs when the AOS is started?

When the AOS is started, we want to automatically change a bunch of system parameters based on the database we are connected to. The purpose of this is so that our Dev/Test/Live systems folders, references, system user accounts, etc will change when the AOS is started.

Are there any classes/methods that are run on AOS start?

EDIT: I’m aware of Classes\Info\startupPost, but this appears to run everytime a user opens AX. I’d prefer it runs only on the start of the AOS.

Starting with a different configuration file doesn’t solve your problem?

Oh no. We restore a copy of our Live data down to Dev/Test periodically. For example, document management has a path \live_files. Well when I go into Test/Dev, our documents still point to \live_files, and I can attach a new document and it will drop it in \live_files.

Where this is dangerous, is the documents are stored via number sequences. Each file you attach, gets the next number seq and the extension. So when our Test/Dev system is 5 days old, and I attach a pdf for testing, that will save to the \live_files\ folder OVER an existing file, because the number sequence has since advanced in the Live system.

Our solution, is during startup of AOS, check the database name, and if it’s the Live DB, then set all the parameters one way. If it’s a Dev/Test DB, then set them another way. Here is how to check what DB you’re on. I don’t want to set the live/test parameters every time any client is connected in the system. And that is what the Info\StartupPost method looks to do.

info(strfmt("%1", new sqlSystem().loginDatabase()));