Skip to main content

Posts

Showing posts from March, 2010

AX - Install multiple workflow instances for Dynamics AX 2009

The standard install for AX2009 and AX2009SP1 does not allow you to run multiple workflow instances on the one machine. There is a KB article which explains how to do it. It requires an install. https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-us;960801 After the install you essentially copy the workflow folder, virtual directory and application pool in IIS. Create your config file (*.axc) and point the web.config file to it.

AX - Using Set-Based Updates in X++

This is a reminder more than anything else. Using set based updates is far more efficient. while select forupdate custTable where custTable.CustGroup == '10' { custTable.CustGroup = '20'; custTable.doUpdate(); } Can be rewritten in X++ as: update_recordset custTable setting CustGroup = '20' where custTable.CustGroup == '10';

AX - Best practice tip for controls

On forms you want to set controls ie enabled or visible You can do this by specifying the control name or the id but the best way is to do it like this: element.design().control(control::Name).visible(false); "control" is a system enum that maps the name to the id. Another advantage of doing it this is, you don't have to set the AutoDeclaration on the form control.

AX - send e-mail job

Sometimes you want to test your SMTP setup. I normally run this job (don't forget to change the parameters): static void sendMail(Args _args) { SysMailer sysMailer; SysEmailParameters sysEmailParameters; ; sysEmailParameters = SysEmailParameters::find(); sysMailer = new SysMailer(); sysMailer.SMTPRelayServer(sysEmailParameters.SMTPRelayServerName, sysEmailParameters.SMTPPortNumber, sysEmailParameters.SMTPUserName, sysEmailParameters::password()); sysMailer.fromAddress("from@defaultemail.com.au"); sysMailer.tos().appendAddress("to@defaultemail.com.au"); sysMailer.subject("test - subject"); sysMailer.htmlBody("test - body"); sysMailer.sendMail(); }