I have a customer module (Customer Onboarding) where I want to create a record for each row in a subform in the Deals module, this currently works, however I'm working in sandbox to change the subform.
resp = zoho.crm.getRecordById("Deals",proid);
acct = zoho.crm.getRecordById("Accounts",accid);
contact = zoho.crm.getRecordById("Contacts",conid);
subinfo1 = ifnull(resp.get("Agreed_Package"),"");
name = resp.get("Deal_Name");
email = contact.get("Email");
Firstname = contact.get("First_Name");
Lastname = contact.get("Last_Name");
sublist = List();
for each rec in subinfo1
{
submp = Map();
submp.put("Name",name);
submp.put("CLI_to_be_Provisioned",ifnull(rec.get("CLI"),""));
submp.put("No_of_Channels",ifnull(rec.get("Quantity"),""));
submp.put("Type_of_Line",ifnull(rec.get("Product"),""));
submp.put("Connectivity",ifnull(rec.get("Product"),""));
submp.put("Line_Order_Type",ifnull(rec.get("Line_Order_Type"),""));
submp.put("BT_Postcode",ifnull(rec.get("Postcode"),""));
/*submp.put("Select_Service_s",ifnull(rec.get("Select_Service_s"),""));*/
submp.put("Email",email);
submp.put("First_Name",Firstname);
submp.put("Last_Name",Lastname);
submp.put("Source",ifnull(resp.get("Lead_Source"),""));
submp.put("Contact_Name",ifnull(resp.get("Contact_Name").get("id"),""));
submp.put("Line_Order_Status","Pending");
submp.put("Account",accid);
submp.put("Deal",proid);
create = zoho.crm.createRecord("Customer_Onboarding",submp);
info create;
}