Zoho CRM Functions 52: Automatically update the recent Event date in the Accounts module!

Zoho CRM Functions 52: Automatically update the recent Event date in the Accounts module!



Welcome back everyone!

Last week's function was about updating Related Records automatically using info from Linking modules. This week, it's going to be about updating a custom field in the Accounts module with information from the Events section of the Activities module.

Business scenario

The importance of spending quality time with your clients and prospects cannot be understated. Be it sharing samples or explaining your products and services, meetings go a long way establishing customer trust. Depending on your line of business, the frequency of client meetings might vary.

Meetings can be tracked under the Events section of the Activities module. With multiple events filling up your calendar, it’s important that the event related information be available contextually. One of our customers had an interesting requirement. They wanted to have a custom field in the Accounts module named “Last Visit Date”, and have the latest event date updated in the same. This would help them get an easy view of the most recent meeting with their clients. Workflows cannot be used to meet this requirement. However, the Function I'm sharing this week helps you update the custom field with the recent event date automatically.

Pre-requisite

  • Create a date/time custom field in the Accounts module with the name "Last Visit Date".

Getting started with the function

  1. Go to Setup > Automation > Workflow Rules.
  2. Click '+ Create Rule'.
  3. Select the Events Module and give the function a name and a description(optional).
  4. Select "On a record action".
  5. Select "Create".
  6. Select "All events" for the Condition.
  7. Choose "Function" from Instant Actions.
  8. Click "+New Function".
  9. Select "Write your own".
  10. Give a name for the function and copy the code given below.
  11. Click on edit Arguments and choose 'Event Id' and name it as 'eventId'.
  12. Click on "Save and Associate".
  13. Save the workflow.

The Code

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

eventDetails = zoho.crm.getRecordById("Events",eventId.toLong());
seid = ifnull(eventDetails.get("What_Id"),"").get("id");
semodule = ifnull(eventDetails.get("$se_module"),"");
fromdate = ifnull(eventDetails.get("Start_DateTime"),"").toDate();
if ( semodule == "Accounts")
{
mp = Map();
mp.put("Last_Visit_Date",fromdate);
updateResp = zoho.crm.update("Accounts", seid.toLong(), mp);
info mp;
info updateResp;
}

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



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.

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