Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Tuesday, September 30, 2014

Set handling in AX

Hi,

static void AlfasithSet(Args _args)
{
Set set = new Set(Types::String);
;
set.add("Alfasith");
set.add("Dynamic");
set.add("AX");
print set.toString(); //{"Alfasith", "Dynamic","AX"}
print set.elements(); //3
print set.in("ERP");    //it return false because EPR is not there in that set
print set.in("AX");    //it return true AX is present in that set
pause;
}
//Duplicate value insertion will not be considered...
to iterate that inserted values.

    InventJournalTrans       inventJournalTrans;
    SetIterator iterator;
    ;
    iterator = new SetIterator(allocationRecIDs);
    while (iterator.more())
    {
        select forupdate inventJournalTrans where inventJournalTrans.JournalId == iterator.value();
        inventJournalTrans.MiscCharges = markupValue;
        inventJournalTrans.update();
        iterator.next();
    }

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...