Calculating the total amount of a subform is not working correctly

Calculating the total amount of a subform is not working correctly

Hi
I was following along the tutorials on zoho site.

Link : https://www.zoho.com/creator/help/tutorials/advanced-app-building.html

Section: SubForm Actions --> 3rd part.

When I'm testing the calculation on my app, the first product that i select within the subform and I am changing the quantity the total amount is working fine, but when I add a new product and I put the quantity at 5 The total amount doesn't make any sense. I don't know if this is a bug or maybe I have did something wrong on my  code part.


And one more question how do you update the total amount when you delete a product in the subform, what is the code for doing that.


Thank you for your time,

Anuar