Deluge Function to create a custom module is only working sporadically...

Deluge Function to create a custom module is only working sporadically...

Hi I hope someone can help we have a Deluge function to create a custom module record when a Deal is created. 

recently this has only been working sporadically. I've also tried to recreate the function as a button to allow me to "manually" create the record if it does fail in the workflow automation, however, this is also not working. The script tells me it's successfully run but no record is created! 

resp = zoho.crm.getRecordById("Deals",proid);
acct = zoho.crm.getRecordById("Accounts",accid);
subinfo1 = ifnull(resp.get("Agreed_Products"),"");
name = resp.get("Deal_Name");
email = acct.get("Email");
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("No_of_Channels"),""));
submp.put("Type_of_Line",ifnull(rec.get("Type_of_Line"),""));
submp.put("Connectivity",ifnull(rec.get("Connectivity"),""));
submp.put("Line_Order_Type",ifnull(rec.get("Line_Order_Type"),""));
submp.put("BT_Postcode",ifnull(rec.get("BT_Postcode"),""));
submp.put("Select_Service_s",ifnull(rec.get("Select_Service_s"),""));
submp.put("Customer_Email",email);
submp.put("Source",ifnull(resp.get("Lead_Source"),""));
submp.put("Contact_Name",ifnull(resp.get("Contact_Name"),""));
submp.put("Line_Order_Status","Pending");
submp.put("Account",accid);
submp.put("Deal",proid);
create = zoho.crm.createRecord("Customer_Onboarding",submp);
info create;
}