Hey all! I am new to the forum and am on a learning curve with these Functions. I could definitely use some help!
Goal: I'm trying to create a function (and workflow) that will create an Event on my calendar upon completing a call or logging a call with all of the call's information, including call duration. I'm super visual and would like to learn how my calls impact my overall productivity.
Example: I called John Doe Today (2/4/21) at 10 AM and spoke for 10 minutes. After entering information into Zoho CRM, an Event is created on my calendar for 2/4/21 stating I had a call with John Doe at 10:00 AM and the event's duration is 10 minutes.
My coding attempt thus far:
CallsDetails = zoho.crm.getRecordById("Calls",input.callsId);
//info CallDetails;
startdate = ifnull(CallsDetails.get("Call_Start"),"");
enddate = ifnull(("Call_Start")+("Call_Duration"),"").toString("yyyy-MM-dd'T'HH:mm:ss");
eventmap = Map();
eventmap.put("Event_Title",ifnull(CallsDetails.get("Subject"),""));
eventmap.put("Who_Id",ifnull(CallsDetails.get("Contact_Name"),"").get("id"));
eventmap.put("Owner",ifnull(CallsDetails.get("Owner"),"").get("id"));
eventmap.put("What_Id",input.callsId);
eventmap.put("$se_module","Calls");
eventmap.put("Start_DateTime",ifnull(CallsDetails.get("Call_Start"),""));
eventmap.put("End_DateTime",enddate.toString("yyyy-MM-dd'T'HH:mm:ss"));
eventmap.put("Status","Completed");
create1 = zoho.crm.createRecord("Events",eventmap);
info eventmap;
info create1;
Thank you guys in advance!