Skip to content

Instantly share code, notes, and snippets.

@jeznag
Created May 23, 2022 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeznag/177b35b9f9f8ca5658150992226844ef to your computer and use it in GitHub Desktop.
Save jeznag/177b35b9f9f8ca5658150992226844ef to your computer and use it in GitHub Desktop.
automatically close tasks for a lead in Zoho CRM
outstanding_tasks_to_close = zoho.crm.getRelatedRecords("Tasks","Leads",lead_id);
for each task in outstanding_tasks_to_close
{
if(task.get("Status") != "Completed")
{
update_payload = {"Status":"Completed"};
update_resp = zoho.crm.updateRecord("Tasks",task.get("id"),update_payload);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment