Announcements
No record found.
can anyone please explain how to use while select statement in ax.
I have gone through docs but I am unable to understand it. Could anyone please explain this with a example.
Thanks,
Nithin.
Hi Nothing,
Not sure if you looked at link below, it has good explanation.
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-data-query#while-select-statements
In short it's a way to loop through records and perform either any calculation or comparison etc. If something is not clear add more details please.
Hi Nithinkumar,
The syntax of a while select statement resembles that of a select statement except that it is preceded by while select instead of select.
Use a while select statement to loop over a set of records that meet some criteria and perform an action on each record.
When you perform data manipulation by using the while select statement, you would typically do this in a transaction to ensure data integrity.
For Example follow code, This prints number within a specified range in myTable.
MyTable myTable; while select myTable where myTable.Num >= "1" && myTable.Num <= "10" { info(strFmt("%1", myTable.Num)); }
https://docs.microsoft.com/en-us/dynamicsax-2012/developer/while-select-statements
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 663
André Arnaud de Cal... 439 Super User 2026 Season 1
Syed Haris Shah 337 Super User 2026 Season 1