Log calls for lead records

Log an outbound call for a lead record at the click of a button in your CRM.

Not all businesses have their CRM integrated with a telephony system. However, many are content with maintaining a call log for communications with leads or contacts using traditional desk or mobile phones. Typically, they only need to record the date and time of the calls made in their CRM. For these businesses, the ability to log a call with the click of a button is invaluable, as they can add context to the call later if needed. Suppose your business seeks to automatically log a call with the start time set to when the button gets clicked, this solution is for you.

All you need to do is write a custom function that logs a call with the required information. This function can then be connected to a custom button in the leads module, allowing you to create the call record by simply pressing the button within a lead. Read on for more details.

Permissions and availability

  • Users with the Modules Customization permission can create custom buttons.
  • Users with the Manage Extensibility permission can write custom functions.
  • Users with the Manage Sandbox permission can manage the sandbox.

Requirements

  • Create and link the button with the custom function, as detailed in the "Create Button" section below. Learn more
  • Test the function in a sandbox before deploying it in your production environment. Learn more

Create a button

Follow the steps below to create a custom button in your Zoho CRM account:

  1. Navigate to Setup > Customization > Modules and Fields > Leads > Buttons > Create New Button.
  2. Provide a name for the button. For example: "Log Call".
    Add a description (optional).
  3. Choose the layouts in which you want the button to be placed.
  4. Specify the button's placement as In Record and its position on the page as Details.
  5. Select the action to be performed as Writing Function.
  6. Provide a name and display name for the function, then click Create.
  7. In the Deluge script editor, do the following:
    1. Copy and paste the code provided below.
    2. Click Edit Arguments.
    3. Enter the name as leadId and select the value as Leads - Lead Id.
    4. Save the function.
  8. Select the profiles who can view this custom button.
  9. Click Save.
Create Button

The code

Code Copied
mp = Map();
mp.put("Subject","entersubject");
info "zoho.currenttime : " + zoho.currenttime; 
ap = zoho.currenttime.toTime("yyyy-MM-dd'T'HH:mm:ss");
mp.put("Call_Type","Outbound");
mp.put("$se_module","Leads");
mp.put("What_Id",leadId);
mp.put("Call_Result","enterresult");
mp.put("Call_Duration","01:00");
mp.put("Call_Start_Time",ap.toString("yyyy-MM-dd'T'HH:mm:ss+00:00"));
info "mp : " + mp; 
create = zoho.crm.createRecord("Calls",mp);
info "create  : " + create;
return "Call logged successfully";

Notes

  • Enter a custom subject and the call result for the call records that will be created.
  • The call logged via the function will have the start time when the button was clicked and a duration of one minute from the start time.
  • Make sure to use the accurate API names for their corresponding fields in the code snippet. Learn more
  • The above script is an example of logging a call for a lead record at the click of a button. You can use this code to log calls from any other module, such as contacts or custom, by modifying the module name and parameters.

Tip

  • Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.

Test the solution

  1. Click the Leads module and select the required list view.
  2. Open the lead record in which you want to log an outbound call.
  3. On the Lead Details page, click the button you added to the page in the top-right area.
    The outbound call will be logged.
  4. Check whether a new call was logged with the details specified in the function.

Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.

More info

  • ModuleLeads
  • Trigger PointCustom Button
  • EditionEnterprise and above
  • ComplexityLow
  • Implementation Time15 minutes

Features used in the solution

Custom ButtonDeluge ScriptSandbox
Story Image

Looking for a custom solution?

Contact us, we will help enhance your productivity at lightning speed.

SUBMIT REQUEST

Developers: Share your solution with our community!