Custom Function

Custom Function

I am a novice with deluge ... we have a custom function setup to convert from lead to account. In that custom function is the instruction to move notes from the lead to the deal. What is wrong with our code causing the notes fall off in the conversion ...

notes = zoho.crm.getRelatedRecords("Notes","Leads",lead_id);
for each  note in notes
{
    note_id = ifnull(note.get("id"),"");
    mp4 = Map();
    mp4.put("Parent_Id",deal_id);
    mp4.put("Note_Content",note.get("Note_Content"));
    mp4.put("Note_Title",ifnull(note.get("Note_Title"),""));
    mp4.put("$se_module","Deals");
    updatenote = zoho.crm.updateRecord("Notes",note_id,mp4);