Print all rows in a table using x++

Hi, I am writing the following code. However it is not iterating through all the records in my table can anyone please help me here?

PdsBatchAttributes x;
while select * from x


There is a limit of how many messages can be shown in infolog. Maybe you’re confusing the number of displayed messages with the number of iterated records.

If it isn’t the case, please give us more information about your actual problem.

Also, when creating a new thread, please always attach a tag with your version of AX.

I am getting just the first record in O/P also when I am using PdsBatchAttributes x;
while select * from x where x.InventBatchId ==“000112”


I am not getting any output. However this particular field is present though its not the first record. Seems the while loop is not iterating over all the records in the table

As far as I can say, while select do work and they’re used frequently in the code base. Rather than assuming that while select doesn’t work, verify that you don’t have any problem in how you execute the code and what assumptions you have about the data.

For instance, maybe you’re running your in a wrong company. If you didn’t forget to mention your versions of AX, I could have told you how to check the settings.

What do you mean by O/P?

By the way, please use Insert > Insert Code to paste source code. It makes it easier to read.