Storing the value of flowfield

Hello,

In Sales Header table I made a FlowField: Total Line Amount. It sums amounts from the connecting sales lines.

Now I need the value of this FlowField in another application, so I thougt to store the value of it in another field (called Order Amount) of Sales Header table.

Is it possible? Is this code right?

CALCFIELDS(“Total Line Amount”);

Order Amount := “Total Line Amount”;

I do not know where to write this code. I tried OnValidate triggers of Order Amount and Total Line Amount fields, and OnInsert, OnModify triggers of Sales Header table, but neither of them was good.

Thank you for any help,

Frida

You can’t do it that way. Unless you are on NAV 2009 and can expose some code via web services you’d have to update the logic to update that field’s value when the sales lines change.

You could also replicate the calc formula in SQL and query the database directly, if you are on SQL.

There is already a Amount field on the sales header table.
Only calcs when the order is released.
Were you trying to accomplish a “running total” type field?
And once the order is completed you want the flowfield value transfered to another field as a “solid” number?

What do you mean by “another application” are you referring to a different table?