Hello, I've read what I can on this and am at a roadblock I cannot pass. I have extended the Sales Line table and Sales Order Subform page to include a new Line_No (text[10) to allow our users to enter a customer defined line number from their purchase order (i.e. 00010, 200, etc etc). I have this transferring without issue to Sales Invoices and Posted Sales Invoices using a TableRelation in the tableextension, however the same methods do not seem to work to transfer to the Warehouse Shipment Line. Full disclosure, I am not a BC developer, however am familiar with AL on a basic level.
How can I transfer this to our Warehouse Shipment after using Get Source Document? I really only need this to transfer from the sales order lines, not transfer orders, or return orders.
The closest I feel I've been able to get to this is with this code, however no luck.
pageextension 50113 lineno_50113 extends "Whse. Shipment Subform"
{
layout
{
addafter("Source No.")
{
Field("Line_No"; Rec.Line_No)
{
ApplicationArea = All;
}
}
}
trigger OnAfterGetRecord();
var
SalesLine: Record "Sales Line";
begin
SalesLine.Reset();
SalesLine.Get(Rec."No.", Rec.Line_No);
Rec.Line_No := SalesLine.Line_No;
end;
Below are my table extensions:
tableextension 50110 lineno_50110 extends "Sales Line"
{
fields
{
field(50110; Line_No; text[10])
{
DataClassification = ToBeClassified;
Caption = 'Line No.';
}
}
}
tableextension 50111 lineno_50111 extends "Sales Invoice Line"
{
fields
{
field(50110; Line_No; text[10])
{
DataClassification = ToBeClassified;
Caption = 'Line No.';
TableRelation = "Sales Line"."Line_No" WHERE("Document No." = FIELD("Document No."));
}
}
}
tableextension 50112 lineno_50112 extends "Warehouse Shipment Line"
{
fields
{
field(50110; Line_No; text[10])
{
DataClassification = ToBeClassified;
Caption = 'Line No.';
//TableRelation = "Sales Line"."Line_No" WHERE("Document No." = FIELD("Source No."));
}
}
}