Hi all,
I'm trying to add aditional information to a sales invoice when using "get shipment lines".
The first line is always the "shipment no" and is found in table 111: SalesLine.Description := STRSUBSTNO(Text000,"Document No.");
I would like to add a second line with the customer reference and external doc no.
SalesLine.Description := STRSUBSTNO(Text000,"Document No.","Customer Order Reference","External Document No.")
I tried all possible solutions to insert a new line, but none seem to work in this case. And almost all hits on google refer to RDLC...
Can someone point me in the right direction please?
//Edit: I'm looking for a solution to display in a page, not a report.
Answers
What is content of you Text000? Maybe, you just need to extend it by new references to newly added parameters?
With "Shipment No. %1 %2 %3" I can get all the data on one line. So data retrieval is no problem.
For the new line I tried with \, \\, \n, LF, CR, CRLF,.... in both the text constant and the code.
This is the current code:
IF SalesLine."Shipment No." <> "Document No." THEN BEGIN
SalesLine.INIT;
SalesLine."Line No." := NextLineNo;
SalesLine."Document Type" := TempSalesLine."Document Type";
SalesLine."Document No." := TempSalesLine."Document No.";
LanguageManagement.SetGlobalLanguageByCode(SalesInvHeader."Language Code");
SalesLine.Description := STRSUBSTNO(Text000,"Document No.");
LanguageManagement.RestoreGlobalLanguage;
SalesLine.INSERT;
NextLineNo := NextLineNo + 10000;
END;
use
IF SalesLine."Shipment No." <> "Document No." THEN BEGIN
SalesLine.INIT;
SalesLine."Line No." := NextLineNo;
SalesLine."Document Type" := TempSalesLine."Document Type";
SalesLine."Document No." := TempSalesLine."Document No.";
LanguageManagement.SetGlobalLanguageByCode(SalesInvHeader."Language Code");
SalesLine.Description := STRSUBSTNO(Text000,"Document No.");
LanguageManagement.RestoreGlobalLanguage;
SalesLine.INSERT;
NextLineNo := NextLineNo + 10000;
SalesLine.INIT;
SalesLine."Line No." := NextLineNo;
SalesLine."Document Type" := TempSalesLine."Document Type";
SalesLine."Document No." := TempSalesLine."Document No.";
LanguageManagement.SetGlobalLanguageByCode(SalesInvHeader."Language Code");
SalesLine.Description := STRSUBSTNO(Text001,"Customer Order Reference");
LanguageManagement.RestoreGlobalLanguage;
SalesLine.INSERT;
NextLineNo := NextLineNo + 10000;
SalesLine.INIT;
SalesLine."Line No." := NextLineNo;
SalesLine."Document Type" := TempSalesLine."Document Type";
SalesLine."Document No." := TempSalesLine."Document No.";
LanguageManagement.SetGlobalLanguageByCode(SalesInvHeader."Language Code");
SalesLine.Description := STRSUBSTNO(Text002,"External Document No.");
LanguageManagement.RestoreGlobalLanguage;
SalesLine.INSERT;
NextLineNo := NextLineNo + 10000;
END;
You just need to create 2 new text contants (e.g. Text001 and Text002) as it's made for Text000.
NL is Text[2] variable
Then you can the use it like this:
Text000 would be then "Shipment No. %1%2%3 %4"
You may need to change properties of the field used to display the SalesLine.Description on your RDLC report to enable Multiline on it.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03