Your Reference in Sales Line

I would like to have the field ‘Your Reference’ form the Sales Shipment Header copied into the Sales Line (as text) when executing the function ‘Get Shipment Lines’ in a Sales Invoice. The Shipment No. is already copied into it (as first line in the invoice) and it would be most convenient if it could be added as text line: Your reference nnnnnnnnnnn Shipment No. xxxxxxx: How to achieve this?

Does no one has any idea how to do this? [V]

Hi! Did I understand you correctly?: You are creating a Sales Invoice, and you call “Get Shipment Lines”. There you want to copy the content of “Your Reference” from the “Sales Shipment Header” that belongs to a selected “Shipment Line” into the new field “Your Reference” in the Invoices “Sales Line”!? Take a look at Codeunit 64 “Sales-Get Shipment”. In the function “CreateInvLines” theres this code ... IF NOT DifferentCurrencies THEN BEGIN SalesShptLine := SalesShptLine2; SalesShptLine.InsertInvLineFromShptLine(SalesLine); END; If you add this, the problem should be solved (haven’t tested myself)IF NOT DifferentCurrencies THEN BEGIN SalesShptLine := SalesShptLine2; SalesShptLine.InsertInvLineFromShptLine(SalesLine); **SalesLine."Your Reference" := SalesShptHeader."Your Reference"; SalesLine.MODIFY;** END; Regards, Jörg

Hi Michiel On the “Sales Shipment Line” Table111 you need to modify the function InsertInvLineFromShptLine. 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.”; SalesLine.Description := STRSUBSTNO(Text000,“Document No.”); SalesLine.INSERT; NextLineNo := NextLineNo + 10000; // New Code If SalesOrderHeader.GET( SalesOrderHeader.“Document Type”::O,“Order No.”) THEN BEGIN SalesLine.INIT; SalesLine.“Line No.” := NextLineNo; SalesLine.“Document Type” := TempSalesLine.“Document Type”; SalesLine.“Document No.” := TempSalesLine.“Document No.”; SalesLine.Description := STRSUBSTNO( ‘Your Reference %1’,SalesOrderHeader.“Your Reference”); SalesLine.INSERT; NextLineNo := NextLineNo + 10000; END; // New Code End END; You miight have to declare SalesOrderHeader as Variable and depending which version you are using you can use the TextConstant instead. I Hope this is of some help[:)]

Thank you both, Joerg and Stephen, In the meantime I have had a solution from my NSC: In the InsertInvLineFromShptLine section from table 111 (as you mentioned, Stephen) lRecSalesShipmentHeader.GET(“Document No.”); SalesLine.INSERT; NextLineNo := NextLineNo + 10000; IF lRecSalesShipmentHeader.“Your Reference” <> ‘’ THEN BEGIN SalesLine.Description := STRSUBSTNO(Text002, lRecSalesShipmentHeader.“Your Reference”); SalesLine.“Line No.” := NextLineNo; SalesLine.INSERT; NextLineNo := NextLineNo + 10000 END; Text variable added and there it is!