Creating a CRM Task and assigning it to a CRM Lead

Creating a CRM Task and assigning it to a CRM Lead

Hi,

Hopefully a very simple question.

I am trying to create a script in Zoho Creator that does a number of things.

After a form is completed and validated do the following:

1. Send an email - Done
2. Create a new lead (or update an existing lead) if it exists - Done
3. Identify the lead ID in point 2 - Done
4. Create a new task for the lead created / updated in step 2 - Problem

I am having an issue with how to create a new CRM Task AND assigning it to a lead. I can create a task, but it does not get assigned to the lead.

Any ideas how do to this.

Currently my code to create the task looks as follows:

  1. myNewTask = map();
  2. myNewTask.put("Contact Name", LeadID);
  3. myNewTask.put("Subject", "My Task Subject");
  4. myNewTask.put("Description", "A description");
  5. crmTaskResp = zoho.crm.create("Tasks", myNewTask);
This will create the task, with the subject and description. The LeadID variable is the ID of the lead in step 2, but the task is not assigned to them.

Anyone have any ideas how to help me out?

Cheers, Paddy