Hi guys
I have a Blueprint which - as a Deal proceeds through it - automatic tasks are created via Workflow Tasks.
This is great, but it relies on CRM users having to manually close tasks as they proceed through the Blueprint.
Ive written a function which closes redundant tasks. Its basically:
- relatedTask = zoho.crm.getRelatedRecords("Tasks","Deals",dealID.toLong());
- for each task in relatedTask
- if(task.get("Status") != "Completed")
- {
- if(stage == "Stage 1")
- {
- if(task.get("Subject").contains("Stage 1 Task"))
- {
- mapVariable = Map();
- mapVariable.put("Status","Completed");
- updateTask = zoho.crm.updateRecord("Tasks",task.get("id"),mapVariable);
- }
- }
- else if(stage == "Stage 2")
- {
- if(task.get("Subject").contains("Stage 2 Task"))
- {
- mapVariable = Map();
- mapVariable.put("Status","Completed");
- updateTask = zoho.crm.updateRecord("Tasks",task.get("id"),mapVariable);
- }
- }
- }
- }
This is great but it relies on the tasks containing a string to identify the task to close. If someone renames the task, then it wont get closed automatically.
What I need to do is be able to target the ID of the workflow task. I can see it in the url via the CRM interface:
So how can I get at the ID?
Thanks