Can't create task programmatically using deluge
I have a Date/Time field like this
when it is edited, I want to create a task using deluge function. I use the code below to create a task. but unfortunately, the task is never created even I run it using 'execute' button on function editor. what went wrong?
- void automation.Create_Task_For_Leads_Follow_Up_In_Deal_Module(Int DEAL_ID)
- {
- dealDetails = zoho.crm.getRecordById("Deals",DEAL_ID);
- nextFollowUpTime = dealDetails.get("Next_Follow_Up_Time").toString("yyyy-MM-dd'T'HH:mm:ss","IST").toTime("yyyy-MM-dd'T'HH:mm:ss").addMinutes(60).toString("yyyy-MM-dd'T'HH:mm:ss+07:00");
- phone = dealDetails.get("Phone");
- popUpReminderTime = nextFollowUpTime.subMinutes(15);
- dueDate = nextFollowUpTime.addHour(2);
- subject = "this is subject";
- description = "this is description";
-
- info popUpReminderTime;
- info dueDate;
- info nextFollowUpTime;
-
- mp = Map();
- mp.put("Subject",subject);
- mp.put("Description",description);
- mp.put("$se_module","Deals");
- mp.put("What_Id",DEAL_ID);
- mp.put("Owner",dealDetails.get("Owner").get("id"));
- mp.put("Due_Date",dueDate);
- mp.put("Remind_At",{"ALARM":"FREQ=NONE;ACTION=POPUP;TRIGGER=DATE-TIME:" + popUpReminderTime.toString("yyyy-MM-dd'T'HH:mm:ss'+07:00'")});
- mp.put("Status","Not Started");
- zoho.crm.createRecord("Tasks",mp);
-
-
- }