Thursday, November 27, 2014

How to build a User List Lookup / Drop Down in AX 2009

User List Lookup / Drop Down
Step 1:Create a method in the form to get the user list lookup
void userListLookup(FormStringControl control)
{
    Args                args;
    MenuFunction        menuFunction;
    Object              formRun;
;

    args = new Args();

    menuFunction = new MenuFunction(menuitemdisplaystr(WorkflowUserListLookup), MenuItemType::Display);
    args = new Args(menuFunction.object());
    args.caller(element);
    args.parm(control.text());

    formRun = ClassFactory::formRunClassOnClient(args);
    formRun.init();
    formRun.run();
    formRun.wait();

    if (formRun.closedOk())
    {
        control.text(formRun.parmTo());
        element.redraw();
    }
}

Step 2: Call the method in the lookup event of the EDT
public void lookup()
{
    element.userListLookup(this);
}


Alternative Method: Just select WorkflowUserListLookup as formhelp on your EDT

Tuesday, November 18, 2014

How to import and compile an xpo from Start Up


How to import and compile an xpo from Start Up
In order to import an XPO from command line in AX 2009 we can use AX32.exe StartUp command;
ax32.exe -StartupCmd=AutoRun_c:\Configuration.XML

The configuration XML would contain path to the AOT object to compile after import the XPO.
    exitWhenDone="true"
    version="4.0"
    logFile="C:\Temp\AxaptaAutorun.log">

     file="C:\Temp\CodeFile.xpo" />