Thursday, October 29, 2015

AX 2012 :Looping through table

looping through table

void clicked()
{
    LTB ltb1;
    LTA lta1;
    MultiSelectionHelper helper = MultiSelectionHelper::construct();
    helper.parmDatasource(LTB_ds);
    LTB1 = helper.getFirst();

    while (LTB1.RecId != 0)
    {
        if(Exception::DuplicateKeyException)
        {
           infolog.clear(Global::infologLine() - 1);

        }

        else
        {
        info(ltb1.A1);
        ttsBegin;
        lta1.clear();
        //select * from LTB;
        lta1.A = ltb1.A1;
        lta1.B = ltb1.B1;
        lta1.C = ltb1.C1;
        lta1.insert();
        ttsCommit;
        info("Posted");

        LTB1 = helper.getNext();

        }
    }
}

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8