Creating Lead and Event in CRM from Creator
Hi, I have read the forum and user guide but am stuck.
This is my code to create a new lead and an event from a creator form.
leadinfo = {
"First Name" : input.First_Name,
"Last Name" : input.Last_Name,
"Phone" : input.Phone,
"Email" : input.Email,
"Solicitor" : input.Solicitor,
"Summary" : input.Interested_In,
"Notes" : input.Description
};
crmResplead = zoho.crm.create("Leads", leadinfo);
newclientid = crmResplead.get("Id");
eventinfo = {
"Event Owner" : "ianrispin@gmail.com",
"Subject" : newclientid,
"Start DateTime" : input.Appointment_Date_Time,
"End DateTime" : input.Appointment_Date_Time,
"Description" : input.Description,
"Phone Number" : input.Phone,
"Email" : input.Email,
"CONTACTID" : newclientid
};
crmRespevent = zoho.crm.create("Events", eventinfo);
The lead is created :)
The event is created :)
But if i try to include this line :
"CONTACTID" : newclientid
Then the event is not created.
If i use this line:
"Contact Name" : newclientid
the event is created but not linked to the lead record.
Whatever I do I cannot figure out how to correctly link the event to the lead record.
Can anyone help?