Error with for each record- update records script
Hi,
I've entered this script into the form "Orders"
- for each z in Clients
- {
- z.Monthly_Spend = Orders[((z.Client_ID in Clients && Month == zoho.currentdate.getMonth()) && Year == zoho.currentdate.getYear())].sum(Order_Cost) ;
- z.Year_to_Date_Spend = Orders[(z.Client_ID in Clients && Year == zoho.currentdate.getYear())].sum(Order_Cost) ;
- }
and I get Error at line:3
Field Monthly_Spend does not exist in the form Orders
This is true- Monthly_Spend is not in the form Orders- but it's supposed to be updated in form Clients! Why am I getting this error, and what should I do to get around it?
Thanks very much, appreciate your help.
Navid