8. September 2016 16:07
DELETEALL;
ServiceItemLine.SETRANGE("Tankstellen Nr.",Glob_Tankstelle.Abnehmernummer);
IF ServiceItemLine.FINDSET THEN
REPEAT
Rec := ServiceItemLine;
ServHeader.GET("Document Type","Document No.");
//Add here to make List sortable
"Starting Date" := ServHeader."Order Date";
Rec.INSERT;
UNTIL ServiceItemLine.NEXT = 0;
//Archive
ServiceItemLineArchive.SETRANGE("Tankstellen Nr.",Glob_Tankstelle.Abnehmernummer);
IF ServiceItemLineArchive.FINDSET THEN
REPEAT
Rec.TRANSFERFIELDS(ServiceItemLineArchive);
ServHeaderArchive.GET("Document Type","Document No.",ServiceItemLineArchive."Doc. No. Occurrence",ServiceItemLineArchive."Version No.");
//Add here to make List sortable
"Starting Date" := ServHeaderArchive."Order Date";
Rec.INSERT;
UNTIL ServiceItemLineArchive.NEXT = 0;
12. September 2016 10:54