Add and Edit dialogs compute

Hi,
How can we easy calculate within the Add and Edit dialogs .
three fields , quantity , unitprice and total .
input in quantity and unit price should update total field ..
Have the normal Forms :
some how I cant get a live update on what is calculated shown in the total field .

Any tips ?

You can check the following thread:

are hidden form fields updated with submit ?

retrieving data on pageload with getbyId , and using it in the form to give the default value .. does not work yet ? what am I doing wrong ?

What are hidden form fields?

The default generated edit pages use getById and populate the default values. Not sure why this isn't working for you. Did you check for any JS errors?

apparently only solution to get it work is , you asking why it is not working .
wrong parameter used .. to initialize the data
Hidden .. == not visible

Thank you

I am sorry but I don't understand your reply. What exactly are you trying to achieve? What have you tried so far and what doesn't work? And did you check the forum threads I have linked in my initial response?

I ment, asking the question gave me the solution .. so I'm happy.

Turns out updating the form fields was working but wehn subiming it does give me an error:

This error means that OData cannot parse a valid model instance from the request payload. Check for any missing required (non-nullable) properties or wrong type (string instead of number or vice versa).

it is the standard add form by using this method of a new formdata does not include all the data ? all fields except for the id ( its a new record ) are nullable .

I am pasing the ${event} in the submit
pasing the formData , has same effect

Did you modify the form in any way? Was it working before the modification?

if I take away all the modifications mentioned in your suggested post : calculated fields , the form works

formData contains only the to be calculated fields :
{aantal:1.0,eenheidprijs:0.0,bedrag:0.0,totaalregel:0.0}
But the form has more fields

Are you trying to post more fields than the C# model has? This won't work.

no , that is not the case:
there is one thing might be it : I have changed a string field to lookup

and ddEenheid has value : ${[{text: 'Korting',value:'korting'},{text:'Bonus',value:'bonus'},{text:'Jaar',value:'jaar'},{text:'Hectare',value:'ha'},{text: 'Meter',value: 'm'},{text: 'Stuks',value: 'stuk'}]}

Post: data with 400 code:

I don't know what eeheid is but the default value seems incorrect. Shouldn't it be lowercase "korting"? That's how it is declared in the ddEenheid: [{text: 'Korting',value:'korting'},

Eenheid: unity
it is a string field in de database accepting varchar(30) , but if the default value is incorrect .. it should display nothing ?