Hello,
I am trying to add a 'Test' column of decimal type to the ' Sales shipment lines' .
I have written the following code to add the column in sales shipment lines by making an table extension in visual studio code.
fields
{
field(50120; Test ; decimal)
{
Caption='Test';
}
}
And i have also added relevant code to display the field on the page by making a page extension
But I am unable to populate it with data.
I tried to add the following code in Table extension to populate it with data from sales line to sales shipment line
modify("No.")
{
trigger OnAfterValidate()
var
SalesLine: Record "Sales Line";
begin
if Type = Type::Item then begin
SalesLine.SetRange("Document No.", Rec."Order No.");
SalesLine.SetRange("Type", Type::Item);
SalesLine.SetRange("No.",Rec."No.");
if SalesLine.FindSet() then begin
Rec."Test" := SalesLine."Outstanding Quantity";
end;
end;
end;
}
what am I doing wrong?
is it possible to populate sales shipment line in another way?
Thank you