lastLotNo := ''; currIdx := 1; RecILE.RESET; RecILE.SETCURRENTKEY("Lot No."); RecILE.SETRANGE(RecILE."Item No.","Delivery Challan Line"."Item No."); RecILE.SETRANGE(RecILE."Document No.","Delivery Challan Line"."Production Order No."); IF RecItem.FINDSET(FALSE,FALSE) THEN BEGIN REPEAT IF lastLotNo <> RecILE."Lot No." THEN BEGIN LotNoVar[currIdx] := RecILE."Lot No."; lastLotNo := RecILE."Lot No."; currIdx += 1; END; UNTIL RecILE.NEXT=0; END;
Answers
Would look like that: