I'm creating a function which when you reopen a Purchase Order it finds the Warehouse Receipt Line related to it and Once prompted can find the lines related to the purchase order and delete it.
The current code I have for it is
recWhseRecieptLine.RESET;
recWhseRecieptLine.SETRANGE("Source Type",recWhseRecieptLine."Source Type");
recWhseRecieptLine.SETRANGE("Source Subtype",recWhseRecieptLine."Source Subtype");
recWhseRecieptLine.SETRANGE("Source No.",recPurchHeader."No.");
IF recWhseRecieptLine.FINDSET THEN BEGIN
IF CONFIRM(Text014,FALSE) = FALSE THEN
EXIT;
recWhseRecieptLine.RESET;
recWhseRecieptLine.SETRANGE("Source Type",recWhseRecieptLine."Source Type");
recWhseRecieptLine.SETRANGE("Source Subtype",recWhseRecieptLine."Source Subtype");
recWhseRecieptLine.SETRANGE("Source No.",recPurchHeader."No.");
recWhseRecieptLine.DELETE(TRUE);
END;
END;
I am however unsure on the SETRANGE I should be using. For example Im unsure where you will find the SourceType and Source Subtype for the warehouse receipt line.

As well as my setRang