Button for Deal Name copying from Company Name

Button for Deal Name copying from Company Name

Hi;

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.

It saves properly but not working:

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

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方