sum of value in another field

hi all!!!

I would like to know if there is a possible way to add up a single field in another field. for e.g

if I have a decimal field ‘A’ and a decimal field ‘B’. If ‘A’ has value 30 in it ‘B’ should also have the value 30, if I overwrite ‘A’ with 50 it should sum up 30 and 50 and field ‘B’ should show the value 80 in it. Basically, it should sum all the values that are being written in the field ‘A’.

Thanks in advance.

You’ll have to do a bit of coding to implement something like this. In the simplest case, you just subscribe to the OnAfterModifyEvent of the table containing the field ‘A’ or write code in its OnModify trigger - depending on your NAV/BC version. In that trigger you add new value of the field A to the current value of the field B.

If you follow NAV best practices, all the values you want summed up, should be stored somewhere in a table. Look at the table 9203 “Budget Matrix” for an example. Here, each data entry in a cell creates a budget entry record, and the matrix page displays the total amount of all entries.

this is right but I found another way, I summed up the xrec and rec to get value.