Auto Populate Data from One Module to Another

Auto Populate Data from One Module to Another

I have 2 modules. The parent module is Properties. The child module is Spaces.

Properties stores data for an entire building including the city given address (single line), legal description (single line) and city (single line). To create a record in Spaces a Property from Properties will need to be selected.

When I add a new entry into Spaces the Address is a lookup field that relates to the Properties module. I have the same titled and type of fields in the Spaces module as I do the Properties module. When the Address is selected from the lookup field in the Spaces module I want the Legal Description and City fields to auto populate from the Properties module information. 

I found many help documents but I worked from this one as it had the best comments to help me figure out how I would have to change my code to fit my situation: https://help.zoho.com/portal/community/topic/make-a-lookup-field-auto-populate-other-fields

Based on this above help document here is my code that I believe should work but does not pull any data as I am hoping it too. Any suggestions on what I may be doing wrong or how I can get this to work?
________

voidgetParentAddressDetails(Int addressId)

// --- get the address record you're on
addresscoe = zoho.crm.getRecordById("Spaces",addressId);

// --- lookup the value in the "Address COE" field on your space, this is returned as an array with "name" and "id" values related to the address you've specified in the lookup field on the Space
addressLookup = addresscoe.get("Property");

// --- if conditional that checks your "Address COE" field on the space, if null, the function terminates, if not null, the below function is carried out
if(addressLookup != null)
{
// --- gets the "id" from the returned list from the "Address COE" field, this is critical because the addressLookup result returns both "name" and "id", you must get the "id" in order to lookup your Address record from the ?Spaces or Properties? module
addressId = addressLookup.get("id");

// --- get the Address record from the Properties module using addressId
property = zoho.crm.getRecordById("Properties",addressId);

// --- get the "City" field value from the related City record
city = ifnull(property.get("City"),"");

// --- get the "Legal Description" field value from the related Legal Description record
legal_description = ifnull(property.get("Legal_Description"),"");

// --- creates a Map() array in which we'll store "City" and "Legal Description" values from the Property record
propertyMap = Map();

// --- add the "Capital" value to the Map()
propertyMap.put("City",city);

// --- add the "Population" value to the Map()
propertyMap.put("Legal_Description",legal_description);

// --- update the currentlead record with the "City" and "Legal" values from its related Property record, which was stored in our propertyMap()
updateProperty = zoho.crm.updateRecord("Spaces",addressId,propertyMap);
}

    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner




                                                            • Sticky Posts

                                                            • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

                                                              Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
                                                            • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

                                                              Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
                                                            • Custom Function : Automatically send the Quote to the related contact

                                                              Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
                                                            • Function #50: Schedule Calls to records

                                                              Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
                                                            • Function #37: Create a Purchase Order from a Quote

                                                              Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ






                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方