Line No.

I need to add a comment into the purchase order comment table.
How can I amend the current code so it finds the last line no and then adds 1000 to it to allow a new entry?

IF QuantityChange THEN BEGIN
IF Purchheader."Released Once" THEN BEGIN
IF recPurchLine.Quantity <> xRec.Quantity THEN BEGIN
recPurchCommentLine.RESET;
recPurchCommentLine.SETRANGE("Document Type",recPurchLine."Document Type");
recPurchCommentLine.SETRANGE("No.", recPurchLine."Document No.");

DO SOMETHING HERE FOR THE LINE NO.

recPurchCommentLine."Comment Type" := recPurchCommentLine."Comment Type"::PurchChange;
recPurchCommentLine.Comment :=
STRSUBSTNO(
Text107,
recPurchLine."Line No.",
xRec.Quantity,
recPurchLine.Quantity);
recPurchCommentLine.Date := WORKDATE;
recPurchCommentLine.INSERT(TRUE);
END;
END;
END ELSE

Best Answer

Answers

Sign In or Register to comment.