...
LOCAL PROCEDURE LineHasBeenCreated@18(VAR ChildReqLine@1000 : Record 246;PlanningComponent@1001 : Record 99000829) : Boolean;
WITH ChildReqLine DO BEGIN
SETCURRENTKEY("Worksheet Template Name","Journal Batch Name",Type,"No.");
SETRANGE("Worksheet Template Name",PlanningComponent."Worksheet Template Name");
SETRANGE("Journal Batch Name",PlanningComponent."Worksheet Batch Name");
SETRANGE(Type,Type::Item);
SETRANGE("No.",PlanningComponent."Item No.");
SETRANGE("Variant Code",PlanningComponent."Variant Code");
SETRANGE("Ref. Order Type","Ref. Order Type"::"Prod. Order");
SETRANGE("Ref. Order Status",PlanningComponent."Ref. Order Status");
SETRANGE("Ref. Order No.",PlanningComponent."Ref. Order No.");
SETFILTER("Planning Level",'>%1',0);
EXIT(FINDFIRST);
END;
...