When this code is ran, I've set up conditions where the repeat loop should fire twice in Navision however it is only executing it once, and not looping a second time.. any ideas why?
There are several components in the table which would be included in the findset, and 2 records in the WhseWorksheetLine which woul be included in the Find set.
recInvSetup.GET;
recCompanyInfo.GET;
recProdOrderComponents.RESET;
recProdOrderComponents.SETRANGE("Prod. Order No.", "Production Order No.");
recProdOrderComponents.SETRANGE("Line No.","Prod. Order Line No." );
recProdOrderComponents.SETRANGE("Routing Link Code", "Prod Routing Line"."Routing Link Code");
IF recProdOrderComponents.FINDSET THEN REPEAT
// Find the Components
recWhseWrkSheetLine.RESET;
recWhseWrkSheetLine.SETRANGE("Worksheet Template Name", recInvSetup."Shortage Batch Name");
recWhseWrkSheetLine.SETRANGE(Name, 'SHORTAGE');
recWhseWrkSheetLine.SETRANGE("Production Order No.", recProdOrderComponents."Prod. Order No.");
recWhseWrkSheetLine.SETRANGE("Item No.", recProdOrderComponents."Item No.");
recWhseWrkSheetLine.SETRANGE("Location Code", recCompanyInfo."Location Code");
IF recWhseWrkSheetLine.FINDSET THEN REPEAT
cuWarehouseManagement.WarehouseWorksheetMovement(recWhseWrkSheetLine, 'SHORTAGE', 'PROCESSING');
UNTIL recWhseWrkSheetLine.NEXT = 0;
UNTIL recProdOrderComponents.NEXT = 0;
*This post is locked for comments
I have the same question (0)