Custom Function To Create Task
Hi Zoho Community,
Below is the Deluge custom function I use to create a new task .
Problem is ; I can't set the correct task owner, it keeps defaulting to the admin user name.
I need the task to be correctly assign to the Quote_Owner variable.... help.
string Untitled_Function12
(string Quote_ID,
string Project,
string Quote_Owner )
- completeDate=zoho.currentdate.addDay(3);
- mp=map();
- mp.put("Task Owner",input.Quote_Owner);
- mp.put("Created By",zoho.loginuserid);
- mp.put("Modified By",zoho.loginuserid);
- mp.put("Subject","Complete Quote");
- mp.put("Due Date",completeDate);
- mp.put("Status","Tasked");
- mp.put("Priority","High");
- mp.put("Subject","Quote for " + input.Project);
- mp.put("Required Action","Send Quote");
- mp.put("Send Notification Email",true);
- mp.put("Related To","Quote ID:" + input.Quote_ID);
- response = zoho.crm.create("Tasks",mp);
- new_task_id=response.get("Id");
- new_task_url="https://crm.zoho.com/crm/EntityInfo.do?module=Tasks&id=" + new_task_id;
- openUrl(new_task_url,"new window",);
- return "";
I've confirmed the variable Quote_Owner has the correct name, pulled from a contact lookup field on the quote module ( where the Create Quote Task button exists )
I suspect line 3 to be the problem
mp.put("Task Owner",input.Quote_Owner);
I tried changing the key to :
mp.put("Activity Owner",input.Quote_Owner);
With no luck
Please help, I've sent my boss ( the admin ) dozens of test tasks trying to figure this out.
Thanks,
Aaron 