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!







                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation
                                        • Sticky Posts

                                        • ZUG (Zoho User Group) In-person Meetups - Learn, Share, and Discuss All Things Zoho

                                          Hi, We hope you are all doing well. We are excited to announce the second leg of our in-person Zoho User Group (ZUG) meetups in your region. A quick update: Our first leg of meetups in 2024 reached completion, and Zoho experts had the opportunity to meet
                                        • Tip #35 - On using Kanban View in Zoho CRM

                                          Hi folks,  It's that time of the week again, and I am back with a quick tip about using Kanban View in Zoho CRM. If you think you missed any of our previous weeks' tips, you can read them here.  Tip #35 - On using Kanban View in Zoho CRM You deal with so many records in CRM every single day! When you click open each module in Zoho CRM, you have hundreds of records, each in various stages of your sales pipeline. Wouldn't it be cool if you had them all sorted automatically without having to filter
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          Hi, Hope you all are well. We're excited to announce our second leg of in-person Zoho User Group (ZUG) meetups in your region. A quick update - Our first leg of meetups in 2024 progressed and reached completion smoothly, where Zoho experts had the opportunity
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          A big warm hello to the Zoho Community, and Happy new year to all of you! We're thrilled to let you know that our ZUG Meetups for 2024 have almost begun, and we can't wait for you to be a part of them. We have some interesting topics in store for this
                                        • Cloning Email Templates across modules in Zoho CRM.

                                          The option of cloning email templates across modules has been a long standing feature request from the Community. Thank you all for being so patient with us. We are happy to inform you all that this enhancement has been rolled out. Just in case you haven't noticed it already, cloning email templates is possible now! Cloning is useful because it cuts down the hassle of having to create the same email templates again for different modules. Here are the steps: Navigate to Settings---> Customization--->Templates


                                        Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl Resources


                                                              Zoho Creator Resources


                                                                Zoho WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • Functions

                                                                      Functions

                                                                    • Meetups

                                                                      Meetups

                                                                    • Kbase

                                                                      Kbase

                                                                    • Resources

                                                                      Resources

                                                                    • Digest

                                                                      Digest

                                                                    • CRM Marketplace

                                                                      CRM Marketplace

                                                                    • MVP Corner

                                                                      MVP Corner

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now