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.
- string custombutton.CredNext(string leadId)
- {
- CredNext
- leadDetails = zoho.crm.getRecordById("Leads", input.leadId.toLong());
- name = ((ifnull(leadDetails.get("First Name"),"")) + " ") + ifnull(leadDetails.get("Last Name"),"");
- mp = map();
- mp.put("Dead Live Chat Leads Name", name);
- mp.put("SMOWNERID", ifnull(leadDetails.get("SMOWNERID"),""));
- mp.put("First Name", ifnull(leadDetails.get("First Name"),""));
- mp.put("Company", ifnull(leadDetails.get("Company"),""));
- mp.put("Email", ifnull(leadDetails.get("Email"),""));
- mp.put("Phone", ifnull(leadDetails.get("Phone"),""));
- mp.put("Mobile", ifnull(leadDetails.get("Mobile"),""));
- mp.put("Lead Source", ifnull(leadDetails.get("Lead Source"),""));
- mp.put("Last Name", ifnull(leadDetails.get("Last Name"),""));
- mp.put("Fax", ifnull(leadDetails.get("Fax"),""));
- mp.put("Lead Status", ifnull(leadDetails.get("Lead Status"),""));
- mp.put("Address Line 1", ifnull(leadDetails.get("Address Line 1"),""));
- mp.put("Postal Code", ifnull(leadDetails.get("Zip Code"),""));
- mp.put("Address Line 2", ifnull(leadDetails.get("Address Line 2"),""));
- mp.put("County", ifnull(leadDetails.get("County"),""));
- mp.put("Description", ifnull(leadDetails.get("Description"),""));
- mp.put("Member", ifnull(leadDetails.get("Member"),""));
- mp.put("Sponsor", ifnull(leadDetails.get("Sponsor"),""));
- mp.put("Partnership Manager", ifnull(leadDetails.get("BDO AAM"),""));
- create = zoho.crm.create("CustomModule1", mp);
- url = getUrl("https://crm.zoho.com/crm/private/xml/Leads/deleteRecords?authtoken=99b9681696a406477bc5327985628a3f&scope=crmapi&id=" + input.leadId);
- return "CredNext Lead Created";
- }