Hi guys,
Just for learning and understanding purpose, when we create query using X++, the usual "while select..." sometime using join table, but if in one of the WHERE condition I'm using a local variable, does it not count ?
I experienced like this scenario:
I have variable Balance and in my query specified something like "while select..... where balance > 0", then realized when balance is 0 the process will still come inside While. I have to put another if condition inside the while statement like:
If (!balance)
continue;
to make it to just skip the rest command inside and next loop.
Thanks
In addition, Its better to check value of variable before the code of while loop.
Hi ken,
You cannot add a variables in the while select or select statement. You need to check that separately in the if condition.
Thanks,
Girish S.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156