Trying to update one record from another

Trying to update one record from another

I am using a custom function and going out of my mind - I just don't know why such an ordinary function is so hard and there should be a standard way of doing this 

I need to get the data from a field in a related record and put it into the same record in another one. In this case for a particular client they want to be able to update Lead filed with the phone number and email address from a contact where the person is already in the CRM

lead=input.leadID.toString();
contact=input.contactID.toString();
contactDetails = zoho.crm.getRelatedRecords("Contacts",lead,contact);
mp = map();
mp.put("Details","John");

This works and the problem seems to be the next bit

mp.put("Email",contactDetails.get("Email"),""));
    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 コンテンツ




                              ご検討中の方