Custom Function To Create Task

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 )
  1. completeDate=zoho.currentdate.addDay(3);
  2. mp=map();
  3. mp.put("Task Owner",input.Quote_Owner);
  4. mp.put("Created By",zoho.loginuserid);
  5. mp.put("Modified By",zoho.loginuserid);
  6. mp.put("Subject","Complete Quote");
  7. mp.put("Due Date",completeDate);
  8. mp.put("Status","Tasked");
  9. mp.put("Priority","High");
  10. mp.put("Subject","Quote for " + input.Project);
  11. mp.put("Required Action","Send Quote");
  12. mp.put("Send Notification Email",true);
  13. mp.put("Related To","Quote ID:" + input.Quote_ID);
  14. response = zoho.crm.create("Tasks",mp);
  15. new_task_id=response.get("Id");
  16. new_task_url="https://crm.zoho.com/crm/EntityInfo.do?module=Tasks&id=" + new_task_id;
  17. openUrl(new_task_url,"new window",);
  18. 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