Container to selectMultiple List using X++ [Dynamics AX]

Hey, If we have a container and want to provide user an option of selecting the values from the container, use selectmultiple function available in Global class.

Here is how the selectMultiple list form looks like

Below example has all the part numbers in the container which will be displayed in the list. Based on the user selection, we can go ahead and use the values.

static void selectMultiple(Args _args)
{
container list;
boolean ok;
int i;
InventTable inventTable;
Map Map = new Map(Types::Integer, Types::String);
int j;
;
while select inventTable
{
j++;
list += [SysListSelect::packChoice(inventTable.ItemId, j ,false)];
Map.insert(j, inventTable.ItemId);
}

if (conlen(list) >0)
{
[ok,list] = selectMultiple(“List of items”,”Select multiple items”,list,[‘Item numbers’]);
if (ok && conlen(list)>0)
{
setprefix(“Selected items are shown below”);
for (i=1; i<= conlen(list) ; i++)
{
info(map.lookup(conpeek(list,i)));
}
}
}
}

Hope this code is useful some day!! 🙂

Advertisements

3 Responses to “Container to selectMultiple List using X++ [Dynamics AX]”

  1. ahmedmuhammadalam Says:

    Hi,

    I am using two form first form has grid which will show the data according to the selected account number from second form. By using CustTable.

    Can you please help me for that by display code.

  2. آپلود سنتر 468 Says:

    May be your best blog I have read!!

  3. Video Capture Card Says:

    Remarkably well executed post!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: