When you generate new leads, they need to be qualified to determine if they are a good fit for your sales team to reach out to. However, following up with every lead can be a tedious task, which can sometimes result in leads being left untouched in your CRM. To manage these leads effectively, you can create follow-up tasks and assign them to your salespeople.
Using functions, you can create a follow-up task with a reminder and assign it to the lead owner with the click of a button. Remember that the function cannot be triggered via a workflow rule, so you must place the button on the list view page of the Leads module in the desired order.
Permissions and availability
- Users with the Manage Custom View permission can create custom views.
- 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
- Create a filter in the Leads module with the following criteria and save it.
- <Created Time> on <Enter the date from 2 days ago>
- <Untouched Records> By <User and System> in the last <2> days
- 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:
- Navigate to Setup > Customization > Modules and Fields > Leads > Buttons > Create New Button.
- Provide a name for the button. For example: "Create tasks for untouched leads".
Add a description (optional). - Choose the layout(s) you want the button to be placed.
- Specify the button's placement as In List and its position on the page as Mass Action Menu.
- Select the action to be performed as Writing Function.
- Provide a name and display name for the function, and click Create.
- On the Deluge Script Editor, do the following:
- Copy and paste the code provided below.
- Click Edit Arguments.
- Enter the name as leadId, select the value as Leads - Lead Id, then click Save.
- Save the function.
- Select the profiles who can view this custom button.
- Click Save.
The code
leadDetails = zoho.crm.getRecordById("Leads",input.leadId);
reminderTime = leadDetails.get("Created_Time").addDay(1).toTime();
//info reminderTime;
mp=map();
mp.put("Subject","Follow up this lead");
mp.put("$se_module","Leads");
mp.put("What_Id",input.leadId);
mp.put("Owner",leadDetails.get("Owner").get("id"));
mp.put("Due_Date",leadDetails.get("Created_Time").toDate().addDay(2));
mp.put("Remind_At",{"ALARM":"FREQ=NONE;ACTION=EMAIL;TRIGGER=DATE-TIME:" + reminderTime.toString("yyyy-MM-dd'T'HH:mm:ss'+05:30'")});
mp.put("Status","Not Started");
mp.put("Send_Notification_Email",true);
createTask = zoho.crm.createRecord("Tasks",mp);
info mp;
info createTask;
return "";
Notes
- The code above will send an email as a reminder to the person who owns the task. However, if you prefer a popup notification, replace 'ACTION=POPUP'. If you want both an email and a popup notification, replace 'ACTION=EMAILANDPOPUP'.
- Replace '+05:30' with the value of your time zone.
- Make sure to use the accurate API names for their corresponding fields in the code snippet. Learn more
Create a filter
Create an Advanced Filter in the Leads module to filter out leads created two days ago and untouched to date.
To accomplish this, follow the steps below:
- Go to the Leads module.
- Select the required Leads list view.
- Under Filter Leads by, select the following combination:
- <Created Time> on <Enter the date from 2 days ago>
- <Untouched Records> By <User and System> in the last <2> days
- Click Apply Filter.
The records that meet the criteria are displayed. - Click Save Filter.
- Enter a name for the filter and click Save.
The filter gets saved for future use.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Click the Leads module and select the required list view.
- Select the filter saved in the above instructions.
The untouched lead records will be displayed. - Click the button you added to the mass action menu in the top area.
- See whether "Follow up this lead" tasks are created and assigned to the owners of the respective lead records.
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
- ComplexityMedium
- Implementation Time30 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST