Copy Extended Text Functionality Logic

gemini_shootergemini_shooter Member Posts: 149
Hello All,

I am trying to understand the Extended Text copy functionality in CU6620 to use to for one of my clients along with a roll-up flag to hide lines on printed invoices. The standard NAV functionality uses the "Attached To Line No." field on Sales Lines. Here is a code snippet from the CU 6620 --> Function --> CopySalesLine

IF (ToSalesHeader."Language Code" <> FromSalesHeader."Language Code") OR RecalculateLines THEN BEGIN
  IF TransferExtendedText.SalesCheckIfAnyExtText(ToSalesLine,FALSE) THEN BEGIN
    ToSalesLine2.SETRANGE("Document Type",ToSalesLine."Document Type");
    ToSalesLine2.SETRANGE("Document No.",ToSalesLine."Document No.");
    NextLineNo := ToSalesLine2."Line No.";
  ToSalesLine."Attached to Line No." :=
      FromSalesLine."Line No.",
      FromSalesLine."Attached to Line No.");

Can Anyone please tell me the logic behind the ELSE STATEMENT. From what I understand if returns the new value of the "Attached to Line No." in the copied Sales Line.

PROBLEM: IF I enter a "Attached to Line No." value in the one of the sales line it should return back the new value based on the END ELSE, if I do not recalculate lines. But the FromSalesLine."Line No." doesn't make any sense.... it is 0,1,2.... and so on instead of 10000,20000,30000.... which causes problems in the TransferOldExtLines codeunit...

Can anyone please explain the logic behind the 0,1,2... I am Copying a POSTED INVOICE TO NEW INVOICE
Sign In or Register to comment.