Zoho CRM Functions 51: Update Related Records automatically using info from Linking modules.

Zoho CRM Functions 51: Update Related Records automatically using info from Linking modules.



Welcome back everyone!

Last week's function was about scheduling calls to records. This week, it's going to be about updating a record in one module with information from the linking modules, when two different records are linked.

Linking Modules

Multi-select lookup fields help create many-to-many relationships between records across modules. Linking Modules help facilitate this records association across modules. The records in the Linking Module contains info from the two 'linked' records. More on that here.

Business scenario

The standard sales process takes a linear approach. It starts with creation of leads followed by conversion to contacts and creation of deals. Depending upon your sales strategy, you can also have ad hoc processes. Campaigns, for instance, can be used to run either time bound sale promotions for existing customers or attract new clients.

Say you run a season ending promotional Campaign and one of your existing customers expressed interest for the same. As the customer already exists as a Contact in CRM, the next logical step is to create a Deal record from the Contact. It helps to make contextual follow-ups if the deal records track the relevant campaign names. Manually mapping them using a lookup field can be quite taxing. The Function I'm sharing this week cuts the manual work and tracks the campaign name automatically in the deal records.

When a Campaign targeted at existing customers is run, the relevant Contacts are associated with it. The Function pulls up the information from the Linking Module, containing the Contact and Campaign details and updates the Campaign name in the Deal Record.

Getting started with the function

  1. Go to Setup > Automation > Workflow Rules.
  2. Click '+ Create Rule'.
  3. Select the Module for which this custom function has to be added and give it a name and a description(optional).
  4. Select "On a record action".
  5. Select "Create".
  6. Select "Deal Owner" and click Next.
  7. Select "All Records" for the Condition.
  8. Choose "Function" from Instant Actions.
  9. Click "+New Function".
  10. Select "Write your own".
  11. Give a name for the function and copy the code given below.
  12. Click On edit Arguments and choose 'Deal ID' and name it as 'dealId'.
  13. Also add another argument. Choose 'Contact ID' and name it 'contId'.
  14. Click on "Save and Associate".
  15. Save the workflow.

The Code

-----------------------------------------------------------------------------------------------------------------------

linkingdata=zoho.crm.searchRecords("Contact_X_Campaigns", "(Multi_Select_Lookup_1:equals:"+input.campaignname+")");
//info linkingdata;
for each campaign in linkingdata
{
contId=campaign.get("Testing_Lookup").get("id");
}
info contId;
mp=map();
mp.put("Contact_Name",contId);
update=zoho.crm.update("Deals", dealId, mp);
info update;

-----------------------------------------------------------------------------------------------------------------------

Note

  • The code given above works only for V2 version of Zoho APIs. Please note that the code WILL NOT work for Version 1.0 APIs.
  • The Function is applicable only when you create Campaigns in CRM. More on that here.

Found this useful? Try it out and let me know how it works! If you have questions, do not hesitate to ask! Do check out other functions shared in this series here.

See you all next week with another interesting function. Ciao!



    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

                                                            • How to reach the official Zoho Support channels and avoid fake ones.

                                                              Dear Customers, Thanks a lot for choosing Zoho! Our applications are built to help achieve your day-to-day business goals. We are committed to engaging with you, to understand and develop solutions that enhance your productivity.  We are happy and ready to help you use our services effectively. Understanding and avoiding fake support Just like using popular bank names and financial applications for phishing purposes, using Zoho and claiming to be providing Zoho Support or services with false numbers
                                                            • Function #35: Close all tasks associated with a lead and create a new task.

                                                              Welcome back everyone! Last week, we learnt how to close all tasks of a deal depending upon the deal stage. This week, let's look at a custom function that lets you close all of the tasks associated with a lead while simultaneously creating a new task, like when you need to halt all progress towards a lead while the lead is not available at the moment but create a reminder task. Business scenario: The success of a company, in one way or another, is determined by the leads it gets. Each lead is just
                                                            • Zoho CRM Webinar - Redesigning Daily User Experiences with Canvas

                                                              <br> Your users across roles use the CRM for day-to-day tasks that are necessary. Whether they perform their tasks on time, the right way, or at all depends on a lot of factors, including User Experience. Many businesses struggle with rigid layouts,
                                                            • Join us at the Canada ZUG Meetup: What’s New in Zoho CRM

                                                              Hello Zoho Community! Start your year with fresh insights into Zoho CRM’s latest updates and tools. Whether you're a CRM beginner or a experienced user, this meetup is crafted to help you optimise your processes and leverage new features. Explore practical
                                                            • CRM Hack #2: Automate sending of birthday greetings to your customers.

                                                                Hello everyone! What sets you apart as a sales person is your ability to add that personal touch to your business relationship with your customers. Sending a gift on a special day, or leaving a note wishing them on their birthdays, are small, yet significant actions that show your customers that you care. And these are actions done without any expectations :) You must be engaging with a lot of customers and it is highly unlikely that they all are your friends on Facebook or some social channel,


                                                            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

                                                                                                            • I want to duplicate a report and name it something else

                                                                                                              Hi, I have created a report, and now want to reproduce it and call it something else. so that I will end up with TWO separate reports with different titles. Please tell me how do I copy / reproduce a report please
                                                                                                            • how to see if a specific contact opened an email in zoho campaign?

                                                                                                              how to see if a specific contact opened an email in zoho campaign?
                                                                                                            • Created Date/Invalid Fields

                                                                                                              Since Saturday we have suddenly had issues with our webhooks and data retrieval from CRM. Specifically how Created Date is handled. It appears there was some sort of change within CRM that broke a lot of our code that has been in place for several years.
                                                                                                            • Zoho Forms - Zoho Drive connection - Shared Drives not supported

                                                                                                              Hello i am stuck with Google Drive Connection There is no supported shared drives Connection is not support shared drives boolean Query Parameters - supportsAllDrives=true&supportsTeamDrives=true to activate fetch files from the shared drives. Ahat need
                                                                                                            • Apply Advance option not shown in report

                                                                                                              We are facing an issue in Zoho Expenses. While approving an Expense Report, the "Apply Advance" option is not appearing under the three dots (More Options). Details: Module: Expense Reports Issue: "Apply Advance" option not visible Status of Report: Awaiting
                                                                                                            • Introducing Profile Summary: Faster Candidate Insights with Zia

                                                                                                              We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
                                                                                                            • Can't create package until Bill created?

                                                                                                              I can't understand why we cannot create a package until a Bill is created? We are having to created draft Bills to create a package when the item is received, but we may not have received a Bill from the supplier. Also, Bill # is required, but we normally
                                                                                                            • Whats the Time out Limit for API Calls from Deluge?

                                                                                                              Hi Creator Devs, We are making API calls to third party server via Deluge. Getting this error message: Error at line : 24, The task has been terminated since the API call is taking too long to respond. Please try again after sometime. Whats the default
                                                                                                            • Zoho Tables instead of Zoho Creator Spreadsheet reports <3

                                                                                                              That would make my day for sure. Zoho Creator is create, but miss data entering as AirTable/Spreadsheet can. Seeing Zoho putting effort in this makes me think maybe one day we could see a similar interface for Zoho Creator spreadsheet reports. B.
                                                                                                            • Community Digest Agosto 2025 - Todas las novedades en Español Zoho Community

                                                                                                              ¡Hola, Zoho Community! Agosto llega a su fin y septiembre nos trae aire fresco a la comunidad: más inteligencia con IA, actualizaciones que elevan la productividad y la recta final hacia Zoholics España 2025. Aquí tienes lo más destacado del mes para
                                                                                                            • Deluge Script: Onboarding → Access Form

                                                                                                              Hello everyone, Edit: Sorry, I think I put this topic in the wrong section. I’ve recently run into an issue that’s been giving me a bit of a headache for the past few weeks. Context: This is my first time using Deluge to create a script, but it’s not
                                                                                                            • How can I optimize a Zoho Site page for SEO when embedding external menu or restaurant links?

                                                                                                              Hi everyone, I’m experimenting with building small content hubs on Zoho Sites and want to make sure I’m doing it in an SEO-friendly way. For example, I tried creating a page that highlights restaurant menu items and linked out to a resource like this:
                                                                                                            • Diff signature for compose new email and replies

                                                                                                              Hi,   How do i have different signature for replies and new emails. its inconvenient to have one large signature for replies. Usually on Outlook we have the option to keep separate signatures for new emails and for replies.
                                                                                                            • Zoho Website Site Speed Up & Setting

                                                                                                              We are experiencing slow loading speeds on our Zoho website and would like assistance in optimizing its performance. Kindly review the site and suggest or implement necessary improvements to enhance speed, especially related to: > Caching mechanisms >
                                                                                                            • Clickjacking: Zoho Vault's Response

                                                                                                              Issue Password manager browser extensions are found vulnerable to clickjacking security vulnerabilities that could lead attackers to steal account credentials, TFA codes, card details, under certain conditions. Reported by Marek Toth, Independent Security
                                                                                                            • Optimize your Knowledge Base for better visibility by allowing search engine crawling and indexing

                                                                                                              All you need to know about no-follow and no-index in KB. What are article crawlability and indexability? Crawlability and indexability are vital for making an article visible and accessible to search engines. When a search engine crawls an article, it
                                                                                                            • No option for pick up in Zoho Books / Inventory but yes on commerce

                                                                                                              Is it planned to release soon on books/inventory?
                                                                                                            • Archiving Contacts

                                                                                                              How do I archive a list of contacts, or individual contacts?
                                                                                                            • Zoho Books - France

                                                                                                              L’équipe de Zoho France reçoit régulièrement des questions sur la conformité de ses applications de finances (Zoho Books/ Zoho Invoice) pour le marché français. Voici quelques points pour clarifier la question : Zoho Books est un logiciel de comptabilité
                                                                                                            • Blueprint Issue - Being able to set a subform field as mandatory

                                                                                                              I'm creating a blueprint. My record involves a subform which is only shown once field is set but the field gets set in step two of the process. My problem - I can't save the record as the subform field is set to mandatory - If I unset the mandatory field,
                                                                                                            • Blueprint - Mandatory file upload field

                                                                                                              Hi, File upload (as we as image upload) field cannot be set as mandatory during a blueprint transition. Is there a workaround? Setting attachments as mandatory doesn't solve this need as we have no control over which attachments are added, nor can we
                                                                                                            • Has anyone created a public ASAP Guide that I can check out?

                                                                                                              I am thinking of adding an ASAP guide to my web application, but I have noticed that the ASAP widget itself can be really slow to load sometimes. Has anyone created a public ASAP Guide that I can check to see how performant it is? I don't want to spend
                                                                                                            • Zoho Books - Include Quote Status in Workflow Field Triggers

                                                                                                              Hi Zoho Books team, I recently tried to create a Workflow rule based on when a Quote is Accepted by the customer. This is something which I thought would be very easy to do, however I discovered that Status is not listed as a field which can be monitored
                                                                                                            • Zoho Books - Show Related Sales Orders on Quotes

                                                                                                              Hi Books team, I've noticed that the Quotes don't show show the related Sales Order. My feature request is to also show related Sales Orders above the Quote so it's easy to follow the thread of records in the sales and fulfilment process. Below screenshot
                                                                                                            • Add VAT/Tax line to bank adjustments

                                                                                                              When categorising transactions and matching bank feeds with transactions such as customer payments, we use the "Add Adjustment" to add things like fees/bank fees. It would be useful to choose a VAT/Tax rate here. Whilst there is a bank charges option when adding a payment, this goes into the default bank charges account. We use the adjustments so that we can choose the account and separate our fees. We use different card providers and Worldpay charges VAT so we are stuck. We cannot integrate with
                                                                                                            • New Menu Layout Feedback

                                                                                                              I'd really like to see the banking item back on the top of the menu. I'm sure part of it is just because that's what I'm accustomed to. However, for a bookkeeping program, I think there's a logic to having banking be on top. Not a giant issue, but something
                                                                                                            • How to use Rollup Summary in a Formula Field?

                                                                                                              I created a Rollup Summary (Decimal) field in my module, and it shows values correctly. When I try to reference it in a Formula Field (e.g. ${Deals.Partners_Requested} - ${Deals.Partners_Paid}), I get the error that the field can’t be found. Is it possible
                                                                                                            • Cannot schedule report delivery

                                                                                                              The only 'send option' available when exporting reports is 'immediately' The option to schedule the report is missing.
                                                                                                            • adding attachment in sendmail script where attachment is in a CRM field

                                                                                                              Hi all, I have a custom field of type 'File Upload' in one of my modules in my CRM. I want to include the file in that field as an attachment to an email - which is done from a button on  the 'Results' module. I have created a script and a button to initiate an email from that module. The Deluge scripting window has allowed me to add arguments for all the fields I need to use except for the one file upload type field. My script currently looks like the below (content of the email omitted). As you
                                                                                                            • Signature field is showing black

                                                                                                              Hello, When customer signed the service form, it is showing as below picture Phone model: iPhone 16 Pro We tried delete and install application, but it not solved. This has on phone of a few person. There is any advice to solve this?
                                                                                                            • [Free Webinar] Learning Table Series - AI-Enhanced Insurance Claim Management in Zoho Creator

                                                                                                              Hello Everyone! We’re excited to invite you to another edition of Learning Table Series, where we showcase how Zoho Creator empowers industries with innovative and automated solutions. Struggling with lengthy claim processes, a lack of visibility into
                                                                                                            • How to update changed purchase account of item in invoice

                                                                                                              I have selected the wrong purchase account for various articles and created invoices. I had to adjust the purchase account in the article afterwards, but the old purchase account is still posted in the transaction-journal of the invoice. To adjust the
                                                                                                            • How can I see content of system generated mails from zBooks?

                                                                                                              System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
                                                                                                            • How can I see content of system generated mails from zBooks?

                                                                                                              System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
                                                                                                            • Zoho Suite is very slow

                                                                                                              Since today Zoho is incredibly slow over all applications! What's going on?
                                                                                                            • Not sure how to use credits to my account

                                                                                                              Hi I have a $50 credit to my account. I'm just wondering how I can apply that to either a current invoice or to try a new service. Any advice would be great, thanks. Kind Regards Chris
                                                                                                            • Control who sees Timeline and Interactions in Zoho CRM through Profiles

                                                                                                              The feature has been enabled for all DCs (except US, EU, and IN DCs). We will be rolling it out to the other DCs in the upcoming days. Dear All, In a CRM, not all users would require access to the history of a record. For instance, a Marketing Operations
                                                                                                            • Zoho Desk Integration - Add the option to send the estimate from the Zoho Desk Ticket Integration

                                                                                                              Hi, Currently in the Zoho Desk integration, the user is able to create an estimate from a ticket, once the estimate is created the user can see the estimate under the ticket (see screenshot below), but is not able to send that estimate from Zoho Desk.
                                                                                                            • Zoho Creator to Zoho CRM Images

                                                                                                              Right now, I am trying to setup a Notes form within Zoho Creator. This Notes will note the Note section under Accounts > Selected Account. Right now, I use Zoho Flow to push the notes and it works just fine, with text only. Images do not get sent (there
                                                                                                            • Utilisation de Zoho en conformité avec l’article 286 du Code général des impôts (CGI)

                                                                                                              Cher(e) client(e), Conformément à l’article 286 du Code général des impôts (CGI) impose aux entreprises assujetties à la TVA d’utiliser des systèmes de caisse ou de gestion commerciale certifiés lorsqu’elles enregistrent des ventes à des particuliers.
                                                                                                            • Next Page