While Loop

pfcspfcs Member Posts: 9
edited 2007-12-23 in Dynamics AX
Hi people,

I'm having a problem and need your help.

I have that filter the InventTable by one of 3 conditions, but whatever the condition I have to run all records with an instruction 'while'.

At this moment i'm writing this code.

inventTable.clear();
if (param == 0) {
select * from inventTable where inventTable.ItemId == itemId;
}
if (param == 1) {
select * from inventTable where inventTable.SCHQ_Process == true;
}
if (param == 2) {
select * from inventTable;
}

while (inventTable) {
info(strfmt("ItemId - %1",inventTable.ItemID));
}

The problem is that it made loop :( someone can help me?

Comments

  • cdlmalherbecdlmalherbe Member Posts: 1
    while (inventTable)
    {
    info(strFmt('%1', inventTable.ItemId));

    next inventTable;
    }
  • pfcspfcs Member Posts: 9
    Thank you cdlmalherbe!
Sign In or Register to comment.