I have prepared a function for Button while creating new - first time starting record of Deal - that team would like that name of project will be generated by clicking button after choosing company name - that button - and the mandatory system field of Deal Name will be filled automatically as company name.
string button.NazwaDealaZNazwyFirmy1(Map param,Map body)
{
recordid = param.toMap().get("ids").get(0);
// Dodano .get(0) aby pobrać pierwszy ID
response = Map();
deal = zoho.crm.getRecordById("Deals",recordid);
if(deal != null && deal.get("Account_Name") != null)
{
accountName = deal.get("Account_Name").get("name");
// Dodano .get("name") dla poprawnego pobrania nazwy
updateMap = Map();
updateMap.put("Deal_Name",accountName);
updateResponse = zoho.crm.updateRecord("Deals",recordid,updateMap);
response.put("message","Nazwa projektu została zaktualizowana");
return response;
}
response.put("message","Brak nazwy firmy do skopiowania");
response.put("status","error");
return response;
}
Please help
Thank you warmly in advance