lundi 13 décembre 2010

How to combine two lists in Dynamics AX from X++

Here is an example :)

static void ListSample(Args _args)
{

    List list1  = new List(Types::Integer);
    List list2  = new List(Types::Integer);
    List combinedList  = new List(Types::Integer);
    int  i;
    ;
   
    for(i=1; i<6; i++)
    {
        List1.addEnd(i);
    }
   
     for(i=6; i<11; i++)
    {
        List2.addEnd(i);
    }
   
    combinedList = List::merge(list1, list2);
   
    print combinedList.toString();
    pause;

}

Happy Daxing!

Aucun commentaire:

Enregistrer un commentaire