Good afternoon.
I have a Custom Button called 'Sold' on Leads.
The idea is that when a Lead becomes a customer, the button is pressed and it generates all of the correct information into the other modules.
This all works fine, however I would also like to change the Lead Owner to a specific value, moving it out of the Sales Teams view and into a specific employees. The new Lead Owner will always be the same person, so the value is static.
Are you able to provide me some insight as to what the code should be for this? I have included the existing button below for reference.
mp = Map();
mp.put("Account_Name",comp_name.toString());
mp.put("Address_Line_1",add1);
mp.put("Address_Line_2",add2);
mp.put("City",city);
mp.put("County",county);
mp.put("Postcode",pcode);
mp.put("Industry",ind);
mp.put("Company_Reg_Nos",reg);
mp.put("Phone",ph);
mp.put("Main_Contact",con_name);
mp.put("Company_Name",ta);
add_cust = zoho.crm.createRecord("Accounts",mp);
info add_cust;
//Contact Mapping
co = Map();
co.put("Name",con_name);
co.put("Customer",add_cust.get("id"));
co.put("Title",ttl);
co.put("Mobile",mob);
co.put("Company_Main_Phone",ph);
co.put("Email",em);
con_add = zoho.crm.createRecord("Contacts1",co);
//billing
bb = Map();
bb.put("Name",comp_name);
bb.put("Customer",add_cust.get("id"));
bb_add = zoho.crm.createRecord("Billing_Details",bb);
//techinfo
tc = Map();
tc.put("Name",comp_name);
tc.put("Customer",add_cust.get("id"));
tc_add = zoho.crm.createRecord("Technical_Information",tc);
//network
nw = Map();
nw.put("Name",comp_name);
nw.put("Customer",add_cust.get("id"));
nw_add = zoho.crm.createRecord("Networks",nw);
info con_add;
lmp = Map();
lmp.put("Lead_Status","Sold");
lup = zoho.crm.updateRecord("Prospects",lid,lmp);
return "Customer Created!";
Many Thanks,
Zayd