Schedule Calls to records

Business scenario:

Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly.

CRM allows to make or take calls directly from the interface, instead of calling from a separate phone. And through this interface, calls can be facilitated within CRM. And while this is a handy feature, a peculiar issue pops up when the call process is automated. Call scheduling cannot be automated, but they could be scheduled as a task. And when the task reminder pops up, agent can make the call.

Wouldn't it be better to directly schedule the call? Many of our customers have been asked for options to automate call scheduling and this function helps you do just that.

 

Getting started with the function:

  1. Go to Setup > Customization > Modules and Fields > Select the required module > Links and Buttons > + New Button.
  2. Provide a name for the button. Add a description(optional).
  3. Choose View Page from the drop-down list.
  4. Select Writing Function from the subsequent drop-down.
  5. Provide a name for the function. Add a description(optional).
  6. Copy the code given below.
  7. Click Edit Arguments.
  8. Enter the name as leadId and select the value as Lead Id.
  9. Save the changes.
  10. Select the profiles who can see this button.
  11. Click Save.
 

The Code:


leadDetails = zoho.crm.getRecordById("Leads", input.leadId);
createdtime = ifnull(leadDetails.get("Created_Time"),"").toTime("yyyy-MM-dd'T'HH:mm:ss").addDay(3);
mp = map();
mp.put("Subject", "Cold Call");
mp.put("Owner", ifnull(leadDetails.get("Owner"),"").get("id"));
mp.put("Call_Type", "Outbound");
mp.put("$se_module", "Leads");
mp.put("What_Id", input.leadId);
mp.put("Call_Start_Time", createdtime.toString("yyyy-MM-dd'T'HH:mm:ss+05:30"));
mp.put("$which_call", "ScheduleCall");
create = zoho.crm.create("Calls", mp);
info mp;
info create;
return "Success";

 

Note:

  • You need to set this function under a Module, like 'Leads'. You can also set this function to trigger for any module you want.
  • The above code works only for API V2.0 and not the previous version.
 

Found this useful? Try it out and let us know how it works! If you have questions, do not hesitate to ask! Share this with your team if you find it useful!

Return to Tips