Custom function for custom Button to create new record in different custom module
Hey,
I was trying to implement a custom button into our CRM which should create a record in a custom module, called "Customers" (API Name "Customers"). The button is in the module "Opportunities" (API Name "Deals"). Clicking on that Button a new record in Customers should be created using the Account Name from the Opportunity record as Customer Name.
I was trying different functions i found online but none of them seem to create a new record. I do get the "success" popup when i click the button but no new record is beeing cerated.
Maybe you can help me:
Argument: dealId = Opportunity - Opportunity Id
dealDetails = zoho.crm.getRecordById("Deals",dealId.toLong());
info dealDetails;
mp = Map();
mp.put("Name",ifnull(dealDetails.get("Account_Name"),""));
mp.put("Customers",dealId);
create = zoho.crm.createRecord("Customers",mp);
info mp;
info create;
return "success";
Many Thanks in advance.