Hi,
How do I loop through all records in a table from first to last?
I'm using this code but it only gives me the first record in the table:
Count :=0;
IF Customer.FIND('-') THEN
MESSAGE('Customer %1 is %2','Name',Customer.Name);
Count:=Count+1;
REPEAT
UNTIL Customer.NEXT <= 0;
Thank you
0
Comments
you should wirte the code you want to repeat in the repeat ... not before or after it
this should work
you don't need a count, cause you can get it so: Customer.COUNT
something different ... do you have any programing experience ? it doesn't seem so learning programing AND navision is very very hard. maybe you should take a course first ?
If your purpose is to count all the records in the customer table than "Customer.Count" should be enough.
Also if you wish to modify or delete some records you should really think about using setfilter or setrange before the find syntax.
That way the processing goes faster.
RIS Plus, LLC
RIS Plus, LLC