Create a task on a account via function
I'm trying to create a function for accounts that creates a task based on certain conditions and processes (that's why it's not possible to just use a workflow). Everything seems to be working fine, with the exception of the task creation. Does anyone knows what am I doing wrong?
On arguments, there is:
id > Accounts - Id
owner > Accounts - Account Owner
company > Accounts - Account Name
- // Create Task
- taskmp = Map();
- taskmp.put("Subject","First Contact");
- taskmp.put("Owner",owner);
- taskmp.put("Priority","High");
- taskmp.put("Status","Not Started");
- taskmp.put("Due_Date",today.toDate());
- taskmp.put("Details","Testing Details");
- taskmp.put("Account",company);
- taskmp.put("What_Id",id));
- taskmp.put("$se_module","Accounts");
- task = zoho.crm.createRecord("Tasks",taskmp);
- info taskmp;
- info task;