Hello all,
My sales team wanted me to create a button in order to log calls easily. Now my function works fine, but they want me to add couple of lines so a specific date field would be filled automatically after the activity is created. Note that the date field to update is not within the "calls" but within the "leads".. can someone help me with this one?
Here is my function:
leadDetails = zoho.crm.getRecordById("Leads",leadid.toLong());
ownerId = leadDetails.get("Owner");
firstName = ifnull(leadDetails.get("First_Name"),"");
lastName = ifnull(leadDetails.get("Last_Name"),"");
callMap = Map();
callMap.put("Subject"," Call done with" + " " + firstName + " " + lastName);
callMap.put("Owner",ownerId);
callMap.put("Call_Start_Time",now.toString("yyyy-MM-dd'T'HH:mm:ss'-07:30'"));
callMap.put("Call_Type","Outbound");
callMap.put("Description","");
callMap.put("Call_Duration","15:00");
callMap.put("What_Id",leadid);
callMap.put("$se_module","Leads");
createcall = zoho.crm.createRecord("Calls",callMap);
//update_follow_date = zoho.crm.updateRecord("Leads", "Next_follow_up", <neKEY-VALUE>)
update_resp = zoho.crm.updateRecord("Leads",leadid,leadDetails);
return "Congradulations, you sucessfully logged a call";
Thanks,
Katherine