Update a custom field in a Deal when a task is created

Update a custom field in a Deal when a task is created

Hopefully somebody can help me...
I am trying to use a custom function to update a custom field in a Deal when a task is created that is related to that Deal. The function is firing ok because I have sent myself test emails but it is not updating the Deal. The custom field is "Task Created" and I want to set it to a value of "True" (it is a Boolean).

Here is the code I have used. If anybody can help, I would really appreciate it.

taskDetails = zoho.crm.getRecordById("Tasks",taskID.toLong());
semodule = ifnull(taskDetails.get("$se_module"),"");
if(semodule == "Deals")
{
seid = ifnull(taskDetails.get("What_Id"),"").get("id");
RelatedSBOs = zoho.crm.getRecordById("Deals",seid);
mp = Map();
mp.put("Task Created","True");
update = zoho.crm.updateRecord("Deals",seid,mp);
info mp;
info update;
}