I'm using the schedule call function for new leads, once a lead matching the criteria is created I want to schedule a call for users + 1 business day at 4:00 PM.
Currently when a new lead is created it schedules for 1 business day at the created time.
leadDetails = zoho.crm.getRecordById("Leads",leadId);
createdtime = ifnull(leadDetails.get("Created_Time"),"").toTime("yyyy-MM-dd'T'HH:mm:ss").addBusinessDay(1);
mp = Map();
mp.put("Subject","1st Call Attempt");
mp.put("Owner",ifnull(leadDetails.get("Owner"),"").get("id"));
mp.put("Call_Type","Outbound");
mp.put("$se_module","Leads");
mp.put("What_Id",leadId);
mp.put("Call_Start_Time",createdtime.toString("yyyy-MM-dd'T'HH:mm:ss"));
mp.put("$which_call","ScheduleCall");
create = zoho.crm.createRecord("Calls",mp);
info mp;
info create;