I have a custom table that I want Posted Sales Invoice header records to be in.
So, Sales Invoice Header table to myowntable.
Now, on the OnAfterInsert trigger of the Sales Invoice Header table, I wrote the following code so that once a new record is created in the Sales Invoice Header table it gets copied over to myowntable.
All seems ok except that Amount and Amount Including VAT shows 0.00 in myowntable. All other fields i.e. No., Sell-to Customer no., Due Date.. All gets copied expect Amount and Amount Including VAT.
trigger OnAfterInsert()
var
recProof: Record "Proof of Delivery";
begin
with recProof do begin
Evaluate(recProof."No.", Rec."No.");
recProof."Sell-to Customer No." := Rec."Sell-to Customer No.";
recProof."Due Date" := Rec."Due Date";
recProof.Amount := Rec.Amount;
recProof."Amount Including VAT" := Rec."Amount Including VAT";
recProof."Currency Code" := Rec."Currency Code";
recProof."Remaining Amount" := rec."Remaining Amount";
recProof."Location Code" := rec."Location Code";
Insert();
end;
end;
Answers
RIS Plus, LLC
From:
https://docs.microsoft.com/en-us/dynamics-nav/calcfields-function--record-
"FlowFields are virtual fields. The values in these fields are not saved in the table. This means that you must use either the CALCFIELDS function or the SETAUTOCALCFIELDS Function (Record) to update them."
RIS Plus, LLC