Quantcast
Channel: Dynamics Ax – Dynamics Ax workshop
Viewing all articles
Browse latest Browse all 11

A Hack to initialize list with multiple values in dynamics Ax

$
0
0

I guess there is a limitation in Axapta that you cannot declare or initialize list with multiple values like any other language. Here is a hack that you can do to initialize the list.

static void ListIntialization(Args _args)

{

str testString = "Hello1,Hello2,Hello3";

List testList = new List(Types::String);

ListIterator listIterator;

container testCon;

testCon = str2con(testString, ",");

testList = con2List(testCon);

listIterator = new ListIterator(testList);

while (listIterator.more())

{

info (strFmt("%1", listIterator.value()));

listIterator.next();

}

}



Viewing all articles
Browse latest Browse all 11

Latest Images

Trending Articles



Latest Images