Copying a Lead to a new Custom Module

Copying a Lead to a new Custom Module

Hi there,

I found a deluge script in this forum from another user who wanted to take a lead and move that lead to a custom module. However, the user wanted to list the copied lead as a dead lead. We do not want to do that. 

I have edited the deluge script to match our needs more or less, I think. However, when I "Save & Execute Script" the compiler finds an error on line 3. Please see below for the deluge script we are using. The issue starts with "{"

If I remove lines 1 and 2 another issue comes up on the "name=((ifnull(leadDetails.get" function. Both cases it things that a ";" is missing. Please help me  out with writing the correct deluge script to copy a lead record from the Leads module into a custom module CustomeModule13.
  1. string custombutton.CredNext(string leadId)
  2. {
  3. CredNext
  4.     leadDetails = zoho.crm.getRecordById("Leads", input.leadId.toLong());
  5.     name = ((ifnull(leadDetails.get("First Name"),"")) + " ") + ifnull(leadDetails.get("Last Name"),"");
  6.     mp = map();
  7.     mp.put("Dead Live Chat Leads Name", name);
  8.     mp.put("SMOWNERID", ifnull(leadDetails.get("SMOWNERID"),""));
  9.     mp.put("First Name", ifnull(leadDetails.get("First Name"),""));
  10.     mp.put("Company", ifnull(leadDetails.get("Company"),""));
  11.      mp.put("Email", ifnull(leadDetails.get("Email"),""));
  12.     mp.put("Phone", ifnull(leadDetails.get("Phone"),""));
  13.     mp.put("Mobile", ifnull(leadDetails.get("Mobile"),""));
  14.         mp.put("Lead Source", ifnull(leadDetails.get("Lead Source"),""));
  15.        mp.put("Last Name", ifnull(leadDetails.get("Last Name"),""));
  16.     mp.put("Fax", ifnull(leadDetails.get("Fax"),""));
  17.         mp.put("Lead Status", ifnull(leadDetails.get("Lead Status"),""));
  18.         mp.put("Address Line 1", ifnull(leadDetails.get("Address Line 1"),""));
  19.     mp.put("Postal Code", ifnull(leadDetails.get("Zip Code"),""));
  20.     mp.put("Address Line 2", ifnull(leadDetails.get("Address Line 2"),""));
  21.     mp.put("County", ifnull(leadDetails.get("County"),""));
  22.     mp.put("Description", ifnull(leadDetails.get("Description"),""));
  23. mp.put("Member", ifnull(leadDetails.get("Member"),""));
  24. mp.put("Sponsor", ifnull(leadDetails.get("Sponsor"),""));
  25. mp.put("Partnership Manager", ifnull(leadDetails.get("BDO AAM"),""));
  26.     create = zoho.crm.create("CustomModule1", mp);
  27.     url = getUrl("https://crm.zoho.com/crm/private/xml/Leads/deleteRecords?authtoken=99b9681696a406477bc5327985628a3f&scope=crmapi&id=" + input.leadId);
  28. return "CredNext Lead Created";
  29. }