Summing up total price in the Order management tutorial

Summing up total price in the Order management tutorial

Good day.

I am new to Zoho creator and I have been following the Order management Tutorial. I got stuck at the Advanced scripting Tutorial 3

I have copied the code as it is, following the tutorial step by step but the code is not working at calculating the total price of the items.

The "Total" field is disabled so user can't edit but the default value "0.0" is not showing and the total products price is not showing. I tried walking-through but I think it might relate to the variable "itemID" used here. I don't have that variable and I am wondering if it is supposed to be auto-generated or user-defined. If user-defined, where do I define this variable in my forms..

//Set Total value with 0.0 USD
input.Total = 0.0;
//loop through all the selected Items and calculate total
//"For each list" task is used
for each itemID in input.Products
{
//Get the Product Row from the Products form
//Fetch record task
productRow = Products [ID == itemID];
//Calculate Total Price
input.Total = (input.Total + productRow.Price);
}

Thank you for your help.