patrickjust3k

generally create tasks

Jun 1st, 2023
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. //gather deal id as input to function
  2. dealDetails = zoho.crm.getRecordById("Deals",dealId);
  3. contactId = dealDetails.get(***search API Names***);
  4. dealOwnerId = dealDetails.get("Owner").get("id");
  5. //general task map
  6. taskMap = Map();
  7. taskMap.put("Subject","insert subject here");
  8. taskMap.put("Owner",{"id":deal_owner_id});
  9. taskMap.put("Who_Id",{"id":contactId});
  10. taskMap.put("What_Id",{"id":dealId});
  11. taskMap.put("$se_module","Deals");
  12. taskMap.put("Priority","Normal");
  13. taskMap.put("Status","Not Started");
  14. taskMap.put("Task_Type","Task Type Here");
  15. taskMap.put("Due_Date",zoho.currentdate);
  16. taskMap.put("Description","Insert Description here");
  17. //after this for each task, just change subject, due date, and description as needed
  18. taskMap.put("Subject","new subject here");
  19. taskMap.put("Description","change description here");
  20. taskMap.put("Due_Date",zoho.currendate.addBusinessDay(1));
  21. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  22.  
Advertisement
Add Comment
Please, Sign In to add comment