AUTOMATIC STARTUP OF AXAPTA

Hello, I don’t know if this is a real Axapta question, but help would be greatly appreciated : I have a few jobs which take about 10 minutes in total, but who have to be executed each working day. In order to make this happen, I am looking for a way to automatically start up axapta on a pc, start the batchprocessing and shut down the application (so I only use the license for 15 minutes at max, but every day). I there a way to invoke that? thx, Kathleen

Hi Kathleen, You can do that but it requires some coding in Axapta. Before I try to explain I should ask if you are familiar with the code, or perhaps have someone that could modify the code for you ? Regards Søren Alexandersen

Hi again… I just got to thinking… :slight_smile: Actually you can do this without coding ! In your Axapta shortcut, include the parameter -startupcmd=Batch For example: C:\Ax_Client_30\Bin\ax32.exe -regimport=\axappl\appl\Shortcut\Production.xpo -regconfig=Prod30 -aol=usr -language=da -startupcmd=Batch This will start batch execution when the Axapta is started, and if you set the Autologoff time to 30 minutes for the user, the Axapta will close after 30 minutes (it will not close as long as a batch job is executed) I hope it was useful…Let me know if anything is unclear. Regards, Søren

Hi there, this looks like something we could really use as well. How would one set which batch group the batch processing uses when it starts up?

Hi sunax… Well…for that you need to code…Here’s how to do it. 1. First modify the “infoRun” method on the class so that it can handle the group name as a parameter. The method should then look something like this: void infoRun() { batchRun batchRun = new batchRun(); ; batchRun.parmUseForm(true); batchrun.parmGroupId(parm); //Our new line sets the group batchRun.run(); } 2. Add this option to your Axapta shortcut: -startupcmd=batch_myBatchGroup Ex: C:\Ax_Client_30\Bin\ax32.exe -regimport=\axappl\appl\Shortcut\Production.xpo -regconfig=Prod30 -aol=usr -language=da -startupcmd=Batch_Inv Where “Inv” is my batch group. This works because, as you can see in the “construct” method on the “sysStartupCmd” class, it uses an underscore to seperate the action and the parameter. So what you can conclude is that the syntax for the startupcmd option is: -startupcmd=_ I hope it makes sense. Regards, Søren

hello Søren, Great idea! Thank you so much for the input. It only have one issue left before I can do this. How do I program my Windows system to start Axapta every day at say 7 PM ? Axapta asks for a password. thx, Kathleen

Hi Kathleen. First make sure you have your shortcut right. Save this shortcut on ex. c:\axaptashortcut.lnk Then make a .cmd file and in that file call the shortcut: c:\axaptashortcut.lnk Then make a scheduled task (i assume you’re running windows xp?) and select your .cmd file to start everyday at 7 PM. But this would start a batch Axapta every evening and not close the one already started so for that you need to add this line in your .cmd file before calling your shortcut: taskkill /F /IM ax32.exe Also only available on XP. This will close the Axapta started the day before and open a new one. Regards Søren

Oh ! On the user u use to start up this batch Axapta you should fill the “Network name” field on the user settings in Axapta and set it to the windows user name. This will bypass the password check in Axapta and Axapta will assume the user is authenticated. Regards, Søren

Hi, I tried, but it doesn’t work. I tried a scheduled task with Excel (I have Win2000) and i get the same message (Could not start)? Kathleen

Søren, I’ve had a little help from a friend and I can let axapta start whenever I want. However, it does ask for the password. So I’m still a step away from having it my way. Any other suggestions? thx, Kathleen

  • See Søren’s most recent post above… Make sure that there is no default user specified in the configuration settings. You also need to add the UserName of the windows user that this program will run under to the Network Account Name of an Axapta user.

I’ve tried the following as mentioned : in the Axapta configuration utility on the tabpage General, I erased my name as user. in Axapta, in my user options I set Network account name to my DOMAIN/LOGIN But now when I start up Axapta I get an empty login screen (no name prefilled). So the password authentication is not bypassed. Where did I go wrong? thx, Kathleen

Ok… I don’t know if it makes any difference, but does your domain user name have a blank password ? Now that you have deleted the username in the configuration utility, try to add this parameter to your shorcut (rigth after the -startupcmd parameter) -user= Let me know what happens… Regards, Søren

Also… make sure that the “Network account name” you enter in Axapta is the domain logon name entered in a pre-windows2000 fashion. And not like some do: username@domain.com Just enter the username as it is with no domain. Regards, Søren

hi Søren, I’ve tried -user=domain\login and I still get the login screen. I’ve tried -user=login and I still get the login screen. My login to our network has no blank password. I’ve set my network account to domain\login f.i. I log on as Kathleen on our domain named CompanyDomain with a non blank password. I’ve set the user account name to CompanyDomain\Kathleen. (I also tried with just Kathleen). Does it require that my password in Axapta is the same as my network password? But nothing helps. Kathleen

Hi Kathleen, No the whole point is that Axapta will bypass it’s own password when a network account name is entered on the user. But perhaps you have two different Axapta users with the same network account name ? Then it will not work because Axapta won’t know which user to use and will display a blank login dialog at startup ! Regards, Søren

hi Søren, It works. Thank you for all your quick replies. It worked with the login without the domain name (and the -user=login property not added to the shortcut) So to any of you out there who want to use automatic startup of axapta with automatic startup of a batch : 1/ in Axapta Configuration Utility, set the User to blank. 2/ in Axapta, add the network account name as your login (without the domain name). Password doesn’t have to be the same. 3/ give your login a logoff time of f.i. 30 minutes. 4/ create a shortcut to the axapta exe (axaptaShortcut.lnk) with the option to the shortcut : -startupcmd=Batch 5/ on your system (2000 and xp for sure), add a scheduled task to start that link every f.i. weekday on 4:30 AM. thx for the help, Kathleen

hi Søren, It works. Thank you for all your quick replies. It worked with the login without the domain name (and the -user=login property not added to the shortcut) So to any of you out there who want to use automatic startup of axapta with automatic startup of a batch : 1/ in Axapta Configuration Utility, set the User to blank. 2/ in Axapta, add the network account name as your login (without the domain name). Password doesn’t have to be the same. 3/ give your login a logoff time of f.i. 30 minutes. 4/ create a shortcut to the axapta exe (axaptaShortcut.lnk) with the option to the shortcut : -startupcmd=Batch 5/ on your system (2000 and xp for sure), add a scheduled task to start that link every f.i. weekday on 4:30 AM. thx for the help, Kathleen

Excellent :slight_smile: