Calculation problems - Field not updating

Calculation problems - Field not updating


Hello,

I have 4 fields in a form that I need to calculate in order to present the result in a 5th, field, but I don't get to do this. :(

I created the below code:

 input.Valor_total = (input.Valor + input.Juros + input.Multa - input.Desconto);

So, if I put the above code on the "On User input" field action of the Valor_total field, it field is not updated after entering values on Valor, Juros, Multa and Desconto, with the result of the calculation, because it is the "last field", I think.


I only got to make the calculation putting the above code on "On add - Validate" and "On add - Success" form actions.

What I need to do is that Valor_total, in the form, be the result of Valor + Juros + Multa - Desconto.

Someone knows how can I do this, please?