MODIFY after GET+NEXT doesn't work

Hi I first use Record.GET() to get a particular record, and then I use Record.NEXT(1) to get the following record. But I can’t do anything with the record, ie when I try to MODIFY it nothing happens? Does NEXT only point to the record so that I have to use FIND or something else thereafter? [?]

Hi, No, NEXT will also retrieve the record. Maybe you have a filter applied? I just tried the following code and it works like a charm: Customer.GET('10000'); Customer.NEXT(1); // You don't need (1) - it's default Customer.Name := Customer.Name + '-XX'; Customer.MODIFY; MESSAGE('%1 %2', Customer."No.", Customer.Name);

OOOps, sorry! I was trying to modify a routing line where the routing header wae ‘certified’. Setting status to ‘Under construction’ solved my problem!!

Maybe you didn’t use the GET correctly (did you include all the fields in the key?). Maybe also there is no record after the one you found. You should always test the result (boolean) of the NEXT function. Cust.GET(ID); IF Cust.NEXT <> 0 THEN // NEXT will give you the next record MESSAGE(Cust.ID) ELSE ERROR('No record after this one.');