Monday, November 26, 2012

Another way of displaying custom options


1. In the AOT, create a new job named SysListSelectSingle:
static void SysListSelectSingle(Args _args)
{
    container choices;
    container headers;
    container selection;
    container selected;
    boolean ok;
    choices = [ ["3.0\nAxapta 3.0", 1, false], ["4.0\nDynamics AX 4.0", 2, false],
    ["2009\nDynamics AX 2009", 3, false], ["2012\nDynamics AX 2012", 4, true]];
    headers = ["Version", "Description"];
    selection = selectSingle("Choose version", "Please select Dynamics AX version", choices, headers);
    [ok, selected] = selection;

    if (ok && conLen(selected))
    {
        info(strFmt("You've selected option No. %1", conPeek(selected,1)));
    }
}

2. Run the job to display the options:


3. Select any of the options, click the OK button, and notice your choice displayed in
the Infolog:


Notice that in this case, the returned value is a container holding the selected options.


No comments: