I want to develop some funtionality for axapta in order to show the user some notifications when he logs. But I don't know what code get executed inmediately when the axapta session starts.
My test users get a startup message when they load up the test version of axapta. I do this by in the Axapta Config Utility putting a message in the "Startup Message" box.
It works for me as users connect to my aos via 1 shortcut to 1 config.
Thank you Andrew. I didn't remember this functionality in the Axapta Config. But the real thing that I need is a class method in Axapta that executes when the user logs in.
So I want to implement a notification system in order to store notifications to the users and it would be displayed when the users log in.
For example, when a item stock is reaching the minimum desirable I want to give a notification to the items manager the next time he logs in to axapta.
Well I have found a place where to put my code before anyone gives an answer.
If we override the methond validatePassword of the class SysPassWord, we can get our code executed after our user/password has been validated in Axapta.
Also in the class SysStartupCommand whe can put code in the methods applInit and applRun that will be executed after logging but in this case, this class methods will be executed only if we put a Startup Command in the Axapta Configuration.
Actually, the correct place to put your code would be in the StartupPost method of the Application class
For example,
// No SYS code must exist in this method
// If you need the startup command, look in the class SysStartupCmd
void startupPost()
{
//--- CRM start
if (!appl.isConfigMode())
{
//--- Prevent call to smmInit during installation of Axapta
//--- If not, code in the method below is run that uses a table that has not yet been created
SmmInit::initFromServer();
}
//--- CRM end
if (curUserId() == 'ikash')
box::info("Item in stock overflow");
}
Comments
It works for me as users connect to my aos via 1 shortcut to 1 config.
hope that helps.
Andrew
So I want to implement a notification system in order to store notifications to the users and it would be displayed when the users log in.
For example, when a item stock is reaching the minimum desirable I want to give a notification to the items manager the next time he logs in to axapta.
Thank you
If we override the methond validatePassword of the class SysPassWord, we can get our code executed after our user/password has been validated in Axapta.
Also in the class SysStartupCommand whe can put code in the methods applInit and applRun that will be executed after logging but in this case, this class methods will be executed only if we put a Startup Command in the Axapta Configuration.
Thanks Pedro
For example,
// No SYS code must exist in this method
// If you need the startup command, look in the class SysStartupCmd
void startupPost()
{
//--- CRM start
if (!appl.isConfigMode())
{
//--- Prevent call to smmInit during installation of Axapta
//--- If not, code in the method below is run that uses a table that has not yet been created
SmmInit::initFromServer();
}
//--- CRM end
if (curUserId() == 'ikash')
box::info("Item in stock overflow");
}
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888
Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/3714582