Please help me in how to create the custom function to search records from custom module in zoho crm.
I am new to zoho crm so I do not have any idea about how to code for this. The workflow triggers on Event create.
In custom module LEADID is inserted into Lead Id field and I want to search record by Lead Id fields value from custom module. In function I passed the lead id for search record. Below is sample code which I create but it does not work .
Lead_id=input.LeadID.toString();
Event_id=input.EventID.toString();
rec = zoho.crm.getRecordById("Events",input.EventID);
resp = zoho.crm.searchRecords("CustomModule1","Lead Id",input.LeadID);
for each ele in resp
{
mp=map();
mp.put("Event Created Time",rec.get("Created Time"));
contactId=ele.get("CUSTOMMODULE1_ID");
updateResp = zoho.crm.updateRecord("CustomModule1",contactId,mp);
}