Custom Function pulling Incorrect Information

Custom Function pulling Incorrect Information

Good afternoon,

I have a custom function (created with the help of Zoho support) which takes information from the contact record in order to create a deal.

When we select a blueprint button in the contact record, to send out an application form, it pops up to validate the following fields: -



Once validated, the blueprint will send out an application form to the contact and also run the following code in order to create an opportunity with information from the above fields, but it is not working properly.
  1. resp = zoho.crm.getRecordById("Contacts",conid);
  2. prop = resp.get("Property_Applied_For").get("id");
  3. pre = resp.get("Property_Applied_For").get("name");
  4. relUnits = zoho.crm.getRelatedRecords("Rental_Units","Properties",prop);
  5. unit = "";
  6. if(relUnits.size() > 0 && relUnits != null)
  7. {
  8. pre = relUnits.get(0).get("Name");
  9. unit = relUnits.get(0).get("id");
  10. }
  11. info "prefix : " + pre;
  12. name = resp.get("Full_Name");
  13. dealName = pre + " - " + name;
  14. mp = Map();
  15. mp.put("Deal_Name",dealName);
  16. mp.put("Opportunity_Type","Tenancy");
  17. mp.put("Pipeline","Tenant");
  18. mp.put("Stage","Awaiting Application");
  19. mp.put("Current_or_Recent_Tenant",true);
  20. mp.put("Contact_Name",conid);
  21. if(unit != "")
  22. {
  23. mp.put("Unit",unit);
  24. }
  25. info "unit:" + unit;
  26. info "mp:" + mp;
  27. upd = zoho.crm.createRecord("Deals",mp);
  28. info upd;

As an example, I have validated the following in the contact record today: -



The output was a deal created with the name "Room 1 (Gold Crest) - <tenant name>" when it should have been "Room 6 (Madison) - <tenant name>" as the validated fields above suggest.

The "property" lookup field in the deal was blank. This should have been "1 Kirkby Road"
The "unit" field in the deal was "Room 1 (Gold Crest)" and as above, this should have been "Room 6 (Madison)".

Is anyone able to see why this might be happening?

Thanks in advance
Rich

    Access your files securely from anywhere











                            Zoho Developer Community





                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts



                                                            • 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


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.

                                                                                                              How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.
                                                                                                            • Attention API Users: Upcoming Support for Renaming System Fields

                                                                                                              Hello all! We are excited to announce an upcoming enhancement in Zoho CRM: support for renaming system-defined fields! Current Behavior Currently, system-defined fields returned by the GET - Fields Metadata API have display_label and field_label properties
                                                                                                            • MS Teams Meeting to Zoho CRM

                                                                                                              Has anyone figured out a good way to push MS Teams meeting info on a trigger of "meeting end" to Zoho CRM? We're looking for a way to take attendees of a meeting and meeting duration and push it into Zoho CRM after the meeting has ended. If I can just
                                                                                                            • Zia's ability to generate and improve content extended to Desk mobile app (iOS and Android)

                                                                                                              In support, agents will have to understand customers' pain points completely to provide empathetic personalized solutions and a positive experience. However, at times, agents might find it challenging to comprehend the customer issues and connect with
                                                                                                            • Introducing Zoho Creator's 2025 Release Projection 2

                                                                                                              Hello Creators! I'm Prakash, from the Creator product management team, and today I'm delighted to unveil our next set of features as part of Release Projection 2 for 2025. With thoughtful analysis and planning, we've curated powerful new capabilities
                                                                                                            • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

                                                                                                              Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
                                                                                                            • Font Size 11 - Zoho CRM Email Templates

                                                                                                              Our company communicates with our vendors exclusively using Calibri Font Size 11, as this is the standard formatting for professional emails. Since the CRM only allows for the selection of font sizes 10 & 12, we have been unable to utilize the CRM email
                                                                                                            • BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING

                                                                                                              As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
                                                                                                            • Customer Grouping

                                                                                                              Hi, how can I group multiple customers into single group. So that I can have idea of accounts receivables of all the customers in single group. Like if there are multiple subsidiaries of same company we have having a business with, and want to view the
                                                                                                            • In arattai received message can't be deleted

                                                                                                              The issue has been noticed in following: arattai app (Android) arattai app (Window) arattai web While the message posted by me may be deleted, the ones received from others can't be. The item <Delete> change to <Report> when the message is a received
                                                                                                            • Improved UI for a Seamless User Experience - Calls, Tasks, and Meetings

                                                                                                              Hello all, We are making UI unification across CRM so that the UI experience is seamless across the product. As part of that effort, we have made changes to the details page of activity-based module records—Meetings, Calls, and Tasks. Let's look at these
                                                                                                            • Enable / show scroll bar when Mega Menu is opened

                                                                                                              Hey there I am using the mega menu add-on and experience a "flicker" whenever the mega menu opens. The reason is, that the scrollbar, which has a width of a few pixels, stops showing when the mega menu opens. As the scrollbar disappears the whole page
                                                                                                            • Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration

                                                                                                              Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
                                                                                                            • Item images

                                                                                                              Can we get an "On hover" expanded image for items please ?
                                                                                                            • Free webinar—Redefining workforce security with Zoho Vault: Passwords, passkeys, and multi-factor authentication

                                                                                                              Hi everyone! Did you know that in Q2 alone, 94 million data records were leaked globally? Behind every breach is a combination of poor password habits, phishing attacks, privilege misuse, and simple human error. The fallout—including reputational damage,
                                                                                                            • Zoho Sign product updates - Q3 2025

                                                                                                              Hello everyone! Q3 was all about AI. Here's the list of features and enhancements that have gone live, along with a list of what we have in pipeline for the last quarter: AI-powered agreement management Sending documents and authenticating recipients
                                                                                                            • Zoho Books Sandbox environment

                                                                                                              Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
                                                                                                            • Quick Create needs Client Script support

                                                                                                              As per the title. We need client scripts to apply at a Quick Create level. We enforce logic on the form to ensure data quality, automate field values, etc. However, all this is lost when a user attempts a "Quick Create". It is disappointing because, from
                                                                                                            • Kaizen #152 - Client Script Support for the new Canvas Record Forms

                                                                                                              Hello everyone! Have you ever wanted to trigger actions on click of a canvas button, icon, or text mandatory forms in Create/Edit and Clone Pages? Have you ever wanted to control how elements behave on the new Canvas Record Forms? This can be achieved
                                                                                                            • DNS set up

                                                                                                              I want to create an email with my company domain. When I tried to add new record with cloudflare it didn't work. The DNS record can't be manually added. I followed the instruction but still can't add it. Could you help?
                                                                                                            • Pocket from Mozilla is closing shop. Don’t lose your favorites . Move them to Zoho Mail Bookmarks now! 📥🔖

                                                                                                              The end of Pocket shouldn't mean the end of your important links and content. Easily import them into Zoho Mail's Bookmarks and continue right where you left off. You can bring over your entire Saves, Collections, and tags just the way they are. Bookmarks
                                                                                                            • How to Send Email from within a custom module (with or without an email template)

                                                                                                              It is possible to send an email from the Deals module. However, I can't find a way to send an email from any of our custom modules. I have tried adding an email field to the modules (even though we don't really want one or need it there). That doesn't
                                                                                                            • General suggestions

                                                                                                              Hello, I've picked this forum as it is at the top of the list! :) First suggestion: A general forum for issues and comments that are not specific to a particular Zoho application. Second suggestion: Put a link on the home page to "Zoho Identity Access Manager" The first suggestion came about because I didn't know where to post the second! ;) Regards Mark
                                                                                                            • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

                                                                                                              The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Managing addresses
                                                                                                            • Can't upload attachments.

                                                                                                              I can't upload attachment in Zoho Mail.
                                                                                                            • Need Guidance on SPF Flattening for Zoho Mail Configuration

                                                                                                              Hi everyone, I'm hoping to get some advice on optimizing my SPF record for a Zoho Mail setup. I use Zoho Mail along with several other Zoho services, and as a result, my current SPF record has grown to include multiple include mechanisms. My Cloudflare
                                                                                                            • How use

                                                                                                              Good morning sir I tried Zoho Mail
                                                                                                            • Zoho Mail Desktop App Not Loading + Can’t Manage Multiple Accounts

                                                                                                              Hi everyone, I’ve been having ongoing issues with the Zoho Mail desktop app for the past few weeks. The app starts to load but gives up midway and never actually opens — there’s no error message, it just stops loading. The main reason I use the desktop
                                                                                                            • Unable to copy into a new document

                                                                                                              Whe I create a new Writer doc and attemp to copy and past I get this message. The only way to copy into a document is I duplicate an existing document, erase the text and save it under a different name and then paste the information. Not ideal. Can you
                                                                                                            • not able to convert pdf to jpg and other forms and vice versa.

                                                                                                              i want to change my pdf to jpg, word, etc and some times jpg to pdf. i don't know how to do in this.
                                                                                                            • Feature Request: Tag, Search, and Report on Individual Private Comments

                                                                                                              Zoho Desk Team, First, I want to say that we are extensive users of Zoho Desk and it is a core part of our support operations. We rely heavily on the private comments feature for internal communication, knowledge sharing, and maintaining a clear history
                                                                                                            • Connecting two modules - phone number

                                                                                                              Hi, I’d like some guidance on setting up an automation in Zoho CRM that links records between the Leads module and a custom module called Customer_Records whenever the phone numbers match. Here’s what I’m trying to achieve: When a new Lead is created
                                                                                                            • Changing an agents email address

                                                                                                              How do you change an agent's email address? I keep getting a red circle even though I am an admin. And on one of my agents he has two email addresses? How is that possible?
                                                                                                            • Creator Change History: Ways to improve

                                                                                                              Hi Everyone, Recently been working in developing this change history(an idea from Zoho Forms) - unlike forms that you can this with a click but using Creator, we can use "old" keyword. The concept I come up with is to put the result in a table however,
                                                                                                            • Error when sending emails from Zoho

                                                                                                              Hello, When trying to send an email from Zoho CRM I keep getting the below error: javax.mail.AuthenticationFailedException: 535 5.7.139 Authentication unsuccessful, the user credentials were incorrect. Any support on this will be much appreciated. Thanks,
                                                                                                            • Zoho Tables is now live in Australia & New Zealand!

                                                                                                              Hey everyone! We’ve got some great news to share — Zoho Tables is now officially available in the Australian Data Center serving users across Australia and New Zealand regions! Yes, it took us a bit longer to get here, but this version of Zoho Tables
                                                                                                            • Zoho Inventory - How to pay a supplier up front then receive multiple deliveries

                                                                                                              How do we manage situations where we pay a supplier up front, then the receive the products in increments? Example Workflow: Create Purchase Order > Receive Bill for full amount > Receive Items 2 or more deliveries. Currently, once a Bill is created against
                                                                                                            • Not all emails from outlook365 migrated to my new zoho account

                                                                                                              I recently setup a new email address hosted by zoho. I migrated all my folders and email from my Outlook365 account to my new zoho account, but not all my emails migrated. Looks like only the past 12 months, or so, made the move. How do I get the rest
                                                                                                            • Zoho Inventory - Composite Items - Assembly - Single Line Item Quantity of One

                                                                                                              Hi Zoho Inventory Team, Please consider relaxing the system rules which prevent an assembly items from consisting of a single line item and outputting a quantity of 1. A client I'm currently working with sells cosmetics and offers testers of their products
                                                                                                            • Clients not receiving emails

                                                                                                              I've been informed that my emails are not being received. Is there anything that I should look into to rectify this? Many thanks!
                                                                                                            • Next Page