Leads flow into your CRM throughout the week from multiple channels, including webforms, imports, manual entries, and integrations. Without a structured review process, these leads can pile up unattended, resulting in delayed follow-ups, inconsistent qualification, and missed conversion opportunities.
A weekly review meeting gives sales teams a dedicated opportunity to evaluate every lead added to the pipeline during the week. Teams can prioritize high-intent prospects, eliminate unqualified leads, and align on next steps before the week ends.
However, manually scheduling meetings for newly created leads can be both time-consuming and error-prone, especially in high-volume environments where leads are generated daily. What if you could automatically schedule a meeting the moment a lead enters your CRM? This is where a custom function can be helpful, particularly when paired with a workflow rule.
By creating a custom function, you can automatically schedule a one-hour meeting for the upcoming Friday whenever a new lead is created. The meeting is titled using the lead's name followed by a custom suffix (e.g., Review Lead"), assigned to the lead owner and associated with the lead record. This ensures that every new lead is accounted for in the weekly review process without any manual intervention. Read on to learn more about how it works.
Permissions and availability
- Users with the Manage Automation permission can create and update workflow rules.
- Users with the Manage Extensibility permission can create custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Create a workflow rule for the Leads module that triggers every time a lead is created in your CRM. Learn more
- Write a custom Deluge function that schedules a Friday review meeting for new leads and assigns it to the lead owner. Learn more
- Test the workflow rule in a sandbox before deploying it in your production environment. Learn more
Create a workflow rule
Follow the steps below to create a workflow rule in your Zoho CRM account:
- Navigate to Setup > Workflow Rules and click + Create Rule.
- Select Leads from the module dropdown list.
- Provide a name for the rule. For example: "Create a meeting for lead review".
- Add a description, if required, then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Create from the dropdown.
- Click Next.
- In the Which Leads would you like to apply the rule to? section, select All Leads, then click Next.
- Under Instant Actions, select Function and Write your own.
- Provide a name for the function, as well as a description, if necessary.
- In the Deluge script editor, do the following:
- Copy and paste the code provided below.
- Click Edit Arguments.
- Choose Leads - Lead Id, name it leadId, and click Save.
- Click Save & Execute Script.
- Click Save on the workflow rule page.
The code
leadDetails = zoho.crm.getRecordById("Leads",leadId);
first = ifnull(leadDetails.get("First_Name"),"");
last = ifnull(leadDetails.get("Last_Name"),"");
name = first + " " + last + " Review Lead ";
dayOfWeek = today.toDate().getDayOfWeek();
if(dayOfWeek = 1)
{
newDate = today.toDate().addDay(5);
}
else if(dayOfWeek = 2)
{
newDate = today.toDate().addDay(4);
}
else if(dayOfWeek = 3)
{
newDate = today.toDate().addDay(3);
}
else if(dayOfWeek = 4)
{
newDate = today.toDate().addDay(2);
}
else if(dayOfWeek = 5)
{
newDate = today.toDate().addDay(1);
}
else if(dayOfWeek = 6)
{
newDate = today.toDate();
}
else if(dayOfWeek = 7)
{
newDate = today.toDate().addDay(6);
}
start = newDate.toString("yyyy-MM-dd");
eventMap = Map();
eventMap.put("Event_Title",name);
eventMap.put("Owner",ifnull(leadDetails.get("Owner"),"").get("id"));
eventMap.put("Start_DateTime",start + "T09:00:00+05:30");
eventMap.put("End_DateTime",start + "T10:00:00+05:30");
eventMap.put("What_Id",input.leadId);
eventMap.put("$se_module","Leads");
createEvent = zoho.crm.createRecord("Events",eventMap);
info eventMap;
info createEvent;Notes
- Make sure to use the accurate API names (e.g., "First Name") for their corresponding fields in the code snippet. Learn more
- Replace the "Review Lead" suffix with your preferred meeting title.
- Replace "+05:30" with the value of your time zone.
- The meeting is scheduled from 9:00 AM to 10:00 AM on the upcoming Friday. Adjust the time and offset as needed to suit your business requirements.
- The function will assign the meeting to the lead owner. If you need it assigned to a different user, replace the Owner value accordingly.
- Change the "newDate" parameter to "today.toDate();" to create a meeting on any other day of the week. Remember that Sunday is 1, Monday is 2, and so on.
- The code above is an example of creating meetings for new leads on the upcoming Friday between 9:00 AM and 10:00 AM to review them. You can use this code for any other module, such as Deals or Contacts, by modifying the module name and parameters.
Tip
- Configure and test the solution in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to the Leads module and click + Create Lead.
- On the Lead Details page, enter the lead's first name, last name, company, and other required information, then click Save.
The workflow rule will be triggered. - Navigate to the Meetings module (or check the Open Activities related list on the lead record) and verify that a new meeting has been created.
- Open the meeting and confirm the following:
- The meeting title contains the lead's name followed by "Review Lead".
- The From Date/Time and To Date/Time fall on the upcoming Friday between 9:00 AM and 10:00 AM.
- The Host matches the lead's owner.
- The meeting is associated with the correct lead record under the Related To field.
- Repeat the test by creating leads on different days of the week to verify that the Friday calculation is accurate for each scenario.
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 PointWorkflow Rule
- EditionEnterprise and above
- ComplexityLow
- Implementation Time15 minutes

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