Report stops after MODIFY/RENAME

I have created a report that renames item based on a rule. When running the report without postuing, all selected items are evaluated and printed by the report. When I do commit (in the onAfterGetRecord section there is a MODIFY and a RENAME) the report works for the first selected item correctly then prints the result and exits. Any reson for that?

Hi Markus On the OnAfterGetRecord Trigger you should get a copy of the Item Record and Change that, Because when you changed and Commited the record the Sort order has Changed. EG Item2.GET(Item.“No.”); Item2.“No.” := NewNo; Item2.MODIFY; or USE RENAME which ever you are trying to do.

Thanks a lot Steve, that was the problem! Stupid me…