Notifications
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 611 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader