Many businesses pursue a looped collaboration model in which responsibilities flow from lead creators to lead owners and then back to creators. For example, one salesperson creates a lead, and another team member is assigned to perform specific tasks related to that lead. Once the owner completes their tasks, the process returns to the creator for closure, review, or additional steps.
If you take a cursory look at your CRM, you'll notice that it only allows task creation for lead owners or designated users and doesn't support task assignments to record creators. This limitation can disrupt business operations, lead to accountability gaps, and increase the manual work required to close the loop. To address this, you can use our low-code tools, such as custom functions, coupled with workflow rules.
Using functions, you can automatically create tasks for lead creators that are due after a certain number of days, and send them email notifications. This is in addition to tasks created for and assigned to lead owners. Sounds interesting? Read on to learn more.
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 creates a follow-up task linked to a specific lead and assigns it to the lead creator. Learn more
- Test the workflow rule in a sandbox before deploying it to 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 > +Create Rule.
- Select the module as Leads from the dropdown list.
- Provide a name for the rule. For example: "Create task for lead creators".
- Add a description, if required, then click Next.
- In the Execute this workflow rule based on section, choose Record Action, then select Create from the dropdown, and click Next.
- In the Which leads would you like to apply the rule to? section, select All Leads, then click Save.
- 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 given 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
resp = zoho.crm.getRecordById("Leads",leadId.toLong());
Leadname = ifnull(resp.get("Full_Name"),"");
creatorId = ifnull(resp.get("Created_By"),"").get("id");
duedate = zoho.currentdate.addBusinessDay(5);
reminderTime = duedate.toString("yyyy-MM-dd " + resp.get("Created_Time").toTime("yyyy-MM-dd'T'HH:mm:ss").getTime(24,true)).toString("yyyy-MM-dd'T'HH:mm:ss'-05:00'");
mp = Map();
mp.put("Subject","Reminder to review " + Leadname);
mp.put("Due_Date",duedate);
mp.put("Owner", creatorId);
mp.put("Priority","High");
mp.put("What_Id",leadId.toLong());
mp.put("$se_module","Leads");
mp.put("Stage","Not Started");
mp.put("Remind_At",{"ALARM":"FREQ=NONE;ACTION=EMAIL;TRIGGER=DATE-TIME:" + reminderTime});
mp.put("Description","Review lead nurturing activities for " + Leadname);
mp.put("Send_Notification_Email",true);
info "mp : " + mp;
createResp = zoho.crm.createRecord("Tasks",mp);
info "createResp : " + createResp;
Notes
- Make sure to use the accurate API names for their corresponding fields (e.g., "Full Name") in the code snippet. Learn more
- The task will be due five business days after the lead is generated, along with a reminder for its completion. To suit your business needs, you can customize the timing and other task details, such as the subject, status, priority, due date, and description.
- The solution is an example of creating tasks for lead creators instead of owners and ensuring that responsibility and engagement are looped back to the original creator. You can use this code for any other module, such as Deals, 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
- Navigate to the Leads module and click +Create Lead.
- On the Lead Details page, enter the lead information, assign its ownership to a different salesperson, and then click Save.
The workflow rule will be triggered. - The lead should show the task assigned to you under the Open Activities section in the related lists.
- Open the task to check whether the due date and other details are correctly pre-filled, as 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 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