How to Populate the Amount field of a Deal by subform's aggregate data

How to Populate the Amount field of a Deal by subform's aggregate data

https://help.zoho.com/portal/community/topic/custom-function-25-%c2%a0populate-the-amount-field-of-a-deal-by-calculating-the-number-of-related-products-and-its-unit-price

I'm trying to do an Deal amount update like this guide but I use a subform to calculate the product amount and price instead. Please help me writing the code.



regards