Button Deluge not working

Button Deluge not working

Please let me know if I need to post this somewhere else - this is my first time using the forums.

I am attempting to build a button with a function that uses a multi-select lookup to build a list of interested buyers for properties based on the zip code of the property and the zip codes in our buyer data, pulling in all buyers with matching zipcodes in their specific areas field (a text field that has zip codes and cities separated by commas).

I do not have any experience in coding with deluge and have been running into a wall after a few hours of using ChatGPT to help me implement this functionality. 

Please see the current script below:
string button.search_contacts_by_zip(String dealId)
{
dealLong = dealId.toLong();
dealRecord = zoho.crm.getRecordById("Deals",dealLong);
if(dealRecord == null)
{
return "No Deal found for ID: " + dealId;
}
dealZip = ifnull(dealRecord.get("Zip_Code"),"").trim();
if(dealZip == "")
{
return "No Zip on this Deal.";
}
// Attempt partial match using :like:
searchQuery = "(Zip_Codes:like:\"" + dealZip + "\")";
contactMatches = zoho.crm.searchRecords("Contacts",searchQuery);
info "contactMatches => " + contactMatches;
// Debug
if(contactMatches.isEmpty())
{
return "No contacts found with '" + dealZip + "' in Specific Areas.";
}
matchingIds = list();
for each  c in contactMatches
{
cId = c.get("id");
// <--- must be "id" here
if(cId != null)
{
matchingIds.add(cId.toLong());
}
}
updateMap = Map();
updateMap.put("Matching_Buyers",matchingIds);
updateResp = zoho.crm.updateRecord("Deals",dealLong,updateMap);
return "Matched " + matchingIds.size() + " buyer(s) for " + dealZip + ".";
}


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Function #46: Auto-Calculate Sales Margin on a Quote

            Welcome back everyone! Last week's function was about displaying the discount amount in words. This week, it's going to be about automatically calculating the sales margin for a particular quote, sales order or an invoice. Business scenario Where there is sales, there's also evaluation and competition between sales reps. A healthy rivalry helps to better motivate your employees to do smart work and close deals faster and more efficiently. But how does a sales rep get evaluated? 90% of the time, it's
          • 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

          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 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 コンテンツ



                                ご検討中の方

                                  • Recent Topics

                                  • Updating Secondary Contact (CCs)

                                    We use Zoho Forms to capture the user request and integrated with Zoho Desk to raise tickets. Active Microsoft login is captured in our Zoho forms and registered as Primary contact in Zoho desk ticket. We also an have an option to raise ticket on behalf
                                  • Email Opt Out Question

                                    Has the problem where if a customer is emailed opt out prevents you sending standard emails? For me this feature is simply to stop any email marketing and should not block people from receiving emails via Zoho mobile, which makes no sense.
                                  • blank page after login

                                    blank page after logging into my email account Thanks you
                                  • WriterTh

                                    After every space Writer goes to capital letters mode in my Android tablet. The cap mode stays till the second letter is typed in the word then it comes to normal mode.
                                  • Does Thrive work with Zoho Billing (Subscriptions)?

                                    I would like to use Thrive with Zoho Billing Subscriptions but don't see a way to do so. Can someone point me in the right direction? Thank you
                                  • Zoho writer unable to merge documents to PDF with basic fonts in Hebrew or fonts from my computer

                                    I created several forms that will be merged into PDF files through Zoho Writer and I am unable to receive the PDF in the basic fonts of the Hebrew language or in the fonts I have on my computer. The writer exports to PDF an exchange font that looks very
                                  • I have already created some Bots, Commands, and Widgets in Cliq, but I am still not seeing the “Create Extension” option in my account. Could you please help me enable or access this option?

                                  • How to setup DKIM / SPF in Zoho Mail

                                    Hello there! I'm having a hard time understanding how to setup the TXT records for SPF and DKIM with Zoho Mail. I'm following the instructions here: https://www.zoho.com/campaigns/help/setup-spf-dkim.html Specifically, when it comes to the value for the
                                  • Cliq iOS can't see shared screen

                                    Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                  • Unusual activity detected from this IP. Please try again after some time

                                    When i try to create new addresses on my account i am getting this error, it has been 24 hours now and i am still getting this error can anyone help
                                  • Support www.camcard.com

                                    Hi, Is it possible CRM Zoho have integrations with https://camcard.com/? Thanks Br, Andy
                                  • Need to add a new admin for my domain

                                    Hello Zoho Support, I am the owner of the domain localeistanbul.com. The current super admin account (admin@localeistanbul.com) is not accessible. I do not want to reset or delete the existing account because I need to keep all existing emails. Please
                                  • Infinite loop of account verification

                                    Hi I can't do anything on my zoho account.  I always get this message Hi Sheriffo Ceesay As a security measure, you need to link your phone number with this account and verify it to proceed further. When ever I supply the details, it displays that the number is associated with another account. I don't have any other account on zoho so this is really annoying. 
                                  • How we cut CRM updates from ~20 minutes down to 2, our real workflow

                                    Updating the Zoho CRM after every call used to be one of the biggest time sucks for our team. By the time you write your notes, clean them up, fill in the fields, and log everything properly… you’ve easily lost 15–20 minutes per call. We started experimenting
                                  • This domain is not allowed to add. Please contact support-as@zohocorp.com for further details

                                    I am trying to setup the free version of Zoho Mail. When I tried to add my domain, theselfreunion.com I got the error message that is the subject of this Topic. I've read your other community forum topics, and this is NOT a free domain. So what is the
                                  • Arattai App Features Update

                                    1. Offline Messaging & Sync Enable users to compose messages without internet and deliver them automatically via peer-to-peer methods (Bluetooth/WiFi Direct) when nearby users are available. This would be a game-changer for rural India with unreliable
                                  • 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
                                  • How to add Product Add-Ons, Mandatory Forms, and Auto-Save Address in Zoho Commerce

                                    Hi all, I need help setting up several behaviors in Zoho Commerce. I can’t find the correct configuration options, so I want to confirm whether these are supported or if there is a workaround. 1. Product-Specific Add-Ons (Example: GWB Subscription) When
                                  • Zoho Workdrive - Communication / Chat Bar

                                    Hi Team, Please consider adding an option to allow admins to turn on or off the Zoho Communication Bar. Example of what I mean by Communication Bar: It's such a pain sometimes when I'm in WorkDrive and I want to share a link to a file with a colleague
                                  • Proposal for Creating a Unique "Address" Entity in Zoho FSM

                                    The "Address" entity is one of the most critical components for a service-oriented company. While homeowners may change and servicing companies may vary, the address itself remains constant. This constancy is essential for subsequent services, as it provides
                                  • Request for Auto PO - Min–Max based Automated Purchase Feature

                                    Dear Zoho POS Team, I’m writing to request a feature enhancement that would significantly streamline inventory management for businesses using Zoho POS — particularly supermarkets, FMCG retail, and multi-store operations like ours. Feature Requested:
                                  • Zohomail

                                    Im trying to setup email address zoho
                                  • PROBLEMA

                                    Salve, non riesco a inviare email, e mi esce una tabela errore temporaneo. come posso risolvere il problema ?
                                  • Forever FREE Business Email with Zoho Mail

                                    Forever FREE Business Email with Zoho Mail: is it available?
                                  • CRM: hosting a single html file in Zoho and displaying it as a widget

                                    I have seen that CRM offers the option of uploading a web project to Zoho itself and displaying it as a widget in CRM. The instructions then talk about setting a development environment with Node and developing an application to upload to Zoho. But I
                                  • Weekly Tips : Make collaboration effortless with Whiteboard in Zoho Mail

                                    Working with your team often means switching between emails, notes, and other applications just to explain an idea. Maybe you are trying to sketch a layout, plan a workflow, or quickly brainstorm ideas—with text alone, things can get confusing. So how
                                  • Formula field number of days between 2 dates

                                    Hi, I want to have a formula field which calculates the following: IF EndDate < TODAY and Oproep is true (this is a checkbox field) than EndDate - StartDate, otherwise TODAY - StartDate It should calculate the number of days How can I write this for
                                  • Tracking Snippet not working in Zoho Marketing Automation!

                                    First off, the fact that you have to wait about 12-24 hours for every response is terrible. How are we supposed to conduct business? Second, we have been trying for several days to get the Tracking Code Snippet in marketing automation to work, to no avail.
                                  • 'email address already exists'

                                    I deleted a user from my organization and want to use the same email address that user had, but the email address seems to still exist somewhere as I get 'email address already exists' when I try and create it. I have deleted the entire organization and
                                  • search and Smart Bar both missing in Mail

                                    One of the users on my account does not have the search bar at the top right or the Smart Bar at the bottom left of the desktop Mail app. Any ideas how to get those back?
                                  • Possible Fraud Site.

                                    Hello. I received a text with the sender's name as zoho, claiming that my account was at risk and that I should sign in at https://verify.zohomails.ru/signin to verify my account. I signed in on the web address above, and a few days later someone hacked
                                  • What's New in Zoho Analytics - November 2025

                                    We're thrilled to announce a significant update focused on expanding your data connectivity, enhancing visualization capabilities, and delivering a more powerful, intuitive, and performant analytics experience. Here’s a look at what’s new. Explore What's
                                  • ZOHO reporting DKIM entries are not configured, when they have been configured and verified by 3rd parties

                                    Why is ZOHO reporting to my organisation users the following: "The DKIM entries in your domain's DNS records are not configured. Please contact your administrator for configuring DKIM to ensure optimal RSVP invite delivery." When I have configured the
                                  • Manage Bookings directly from Zoho Mail

                                    Greetings from the Zoho Bookings team! We’re introducing the new Zoho Bookings extension for Zoho Mail, designed to help you view appointments, copy time slots and share booking links without leaving your inbox. This integration brings scheduling right
                                  • My notes from the past 2 months have disappeared

                                    Hola, necesito ayuda urgente. Hoy, al iniciar sesión en mi Zoho Notebook como todos los días, me llevé una gran sorpresa al descubrir que todas mis notas de los últimos dos meses habían desaparecido. Estas notas son muy importantes para mí, ya que uso
                                  • How can I load a network into the cliq desktop app?

                                    I have both the standard cliq log in for my org and I am part of a cliq network. In the browser I can choose which I log in to. However, in teh desktop app if I log in it will alwasy load my org's cliq. Can I switch this to the network I have create
                                  • Ability to modify what displays in calendar invite?

                                    I am a long time calendly user and want to make the switch to bookings.  I understand that there is not currently a meets/hangouts integration, is one on the roadmap? Is there anyway I can modify the calendar invite to include the meet link?  I can add it to the emails no problem, but I would also like it to display on their calendar.  Is there some work around I can do to get it on the calendar?  Also am I able to modify the calendar event title?
                                  • Issue with Booking Confirmation Page Not Displaying, Leading to Customer Anxiety and Unnecessary Support Calls

                                    I am writing to express my growing concern regarding the confirmation process in Zoho Bookings, particularly the inconsistent display of the confirmation page after a successful payment. As a mobile service provider, I rely on Zoho Bookings platform for
                                  • Is it possible to turn off all capabilities for a customer to schedule, reschedule or cancel an appointment?

                                    Is it possible to turn off all capabilities for a customer to schedule, reschedule or cancel an appointment? I would like to set it up so only staff can schedule appointments. Is this possible?
                                  • Is there a way to generate a virtual meeting for a group service in Zoho Bookings?

                                    Are virtual meetings not supported for group services/meetings? I have integrated Zoom with one-on-one services, but I need a way to create an online group meeting. Thanks
                                  • Next Page