I've created button to get the value and to update the line, but only the first line is updated
pageextension 50105 ContactL extends "Commodity Receipt Subform"
{
actions
{
addfirst("F&unctions")
{
action("Calculate Qty Remaining")
{
Promoted = true;
PromotedCategory = Process;
ApplicationArea = All;
trigger OnAction()
begin
GetValuationQtyCalcQtyRemain();
end;
}
}
}
procedure GetValuationQtyCalcQtyRemain()
var
line: Record "Purchase Line";
begin
if (line.Get("Document Type", "Document No.", "Line No.")) then begin
line.CalcSums("Valuation Quantity");
Valuationqtyrec := Rec."Valuation Quantity";
Rec.Modify();
end;
end;
}