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!

    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





                                                        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

                                                                                                        • Suggesting enhance for criteria based data-sharing rules

                                                                                                          I suggest that, for user fields, the logged-user system variable could be used. This would allow the user, for example, to access records in which he/she is mentioned in a specific field, other than the owner. Thanks! Eduardo
                                                                                                        • How to sync read mails to GMail?

                                                                                                          Hello I am testing Zoho TeamInbox but I have an issue with my connected GMail account. Whenever I read a mail in TeamInbox or even reply to it, the email stays as "unread" in GMail. Is this normal behaviour? I thought that with the 2-way sync of IMAP
                                                                                                        • Look up field and show or hide section based upon selection

                                                                                                          Hi there, I am looking to show or hide a section within the opportunities module based on the value of the selection in the look-up field. This feature does not seem to be there Is there a workaround, and is this option coming in a future release? Thanks
                                                                                                        • eway Bill - Import (Good / Material)

                                                                                                          As we Importer of goods , for That first we Generate PO then , Payment, then after We create Bill of Entry  After Bill of Entry Anywhere (99%) cases material that arrived to port that comes to warehouse / factory for that Eway bill , we have to create
                                                                                                        • Import of Bank Statement DO NOT work - Date Mapping issue - Basic Feature Issue Becoming Serious Pain

                                                                                                          Hello, Yes, This is True. Importing Bank Statement feature is Not working as Intended. Facing few issues. Specially regarding the Mapping of Date field format. No matter how many times, we create a Case with Support team, they are NOT supporting in proper
                                                                                                        • Approval Workflow for Purchase Orders Abrir

                                                                                                          The requirement is , that all purchase orders greater than or equal to 5000 go through an approval process from certain people, but within books I only see that the approvers can be by levels or any approver but we cannot enter a rule like these. Can
                                                                                                        • How to see and amend Primary Clients easily

                                                                                                          Hi, i'm trying to make some reports on the clients we do projects for. However, i'm seeing a lot of "unknown" clients in the Zoho Analytics report. I suspect that these projects have not been assigned well and this needs to be corrected. Where can i easily
                                                                                                        • ZOHO NEEDS TO CREATE AN OPTION TO PASS CREDIT NOTE AGAINST SALES RECEIPT

                                                                                                          Zoho needs to find a way to pass credit note on sales receiptS. Creating a dummy invoice is causing major issues in tallying our sales figures and compliance with tax authorities.My system is tied to tax agencies and trying these options causes major
                                                                                                        • INTERGRATION OF ZOHO BOOKS PREMIUM PLAN AND ZOHO INVENTORY STANDARD PLAN

                                                                                                          Hello. I was using Zoho Books premium plan with 3 branches and has been working well until I purchased Zoho Inventory Standard plan. Now my 3rd branch location has been deactivate din Zoho Premium. how can I solve this please since I use all the locations
                                                                                                        • Exporting Templates

                                                                                                          I have just spent 2 hours creating a project template for a Netsuite configuration, and want to share it with other Zoho Projects users - who have a different account. Is there any way to do this?
                                                                                                        • Facing issue in getting data through api calls

                                                                                                          I have send data of users and want to get the data oof users but facing issue with one field for that I want help
                                                                                                        • It's time to say goodbye to Zoho Recruit for me.

                                                                                                          Hello, I have been a Zoho Recruit user since 2013. The tool has evolved, with a better UI, new features and so on. The pricing is still a great asset too. BUT, that being said, important features are not coming fast enough. I tried to share my point of
                                                                                                        • Automation#34: Schedule Guided Conversations (GC) Based on Business Hours

                                                                                                          Hello Everyone, Welcome to this episode on configuring your Guided Conversations (GC) based on your business hours. In our previous episode on Guided Conversations, we covered how to set up GC to enable offline support. This time, we'll guide you through
                                                                                                        • Download PDF from File Field with the name in another single line field

                                                                                                          Hi I am storing a PDF file in a File Field of a Form using Zapier automatically. now i need to download that file and set its file name as per the value stored in a single line field in that form. ANy turnout for that Thanks
                                                                                                        • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

                                                                                                          Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
                                                                                                        • TeamInbox and Desk Integration is Broken

                                                                                                          I use the TI -> Desk integration a lot. Today, it broke, again. When I go to create a Ticket from TI, an error message on a red background is shown "oops something went wrong". Checking the developers console on my browser, there are many 500 errors relating
                                                                                                        • Boost collaboration in your sales process with Team Selling and Deal revenue's Split—empowering your Zoho CRM for smarter teamwork!

                                                                                                          This feature is currently available for the AU and SA DCs. It is being rolled out in a phased manner and will be available to all users shortly. Hello everyone, As you may all know, closing a deal is rarely a one-person effort. It often involves multiple
                                                                                                        • Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000

                                                                                                          Hey, i get a error up "Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000" But i tried same passwords and info. to make imap on hotmail. and it works flawlessly. Has to be something with zoho....
                                                                                                        • Reply-To Match condition for Inbound Mail Messages

                                                                                                          I've trying to setup a rule to match the "reply-to" header but can't find any condition that would match this in Zoho TeamInbox rules. The business case is that I've setup my team inbox to be a member of a google group. The result of that is that emails
                                                                                                        • No Emails Flowing To Zoho TeamInbox

                                                                                                          From today, any emails we send to our TeamInbox addresses fail to be delivered. Our TeamInbox is connected via IMAP to 2 x Zoho Mail accounts. If I log in to those accounts directly via Zoho Mail, I can see all the emails landing in the inbox. The emails
                                                                                                        • How to download Renamed File that already updated to Zoho Creator.

                                                                                                          Hi members, I construct a button with report workflow. link = "https://creatorexport.zoho.com" + zoho.appuri + "report_link_name/File_upload/image-download/" + input.File_upload; openUrl(link,"new window"); This script able to download the file. But I
                                                                                                        • Merge Join PDFs Zoho Creator

                                                                                                          Hi all, I have a field where users upload PDF, is it possible to join those pdfs into one with a function or something? Regards.
                                                                                                        • Project Statuses

                                                                                                          Hi All, We have projects that sometimes may not make it through to completion. As such, they were being marked as "Cancelled". I noticed that these projects still show as "Active" though which seems counter intuitive. In fact, the only way I can get them
                                                                                                        • Mail API Get Email Attachment Content Returns HTTP Status 406

                                                                                                          Hi, I am trying to get the email attachments via the Mail API (https://www.zoho.com/mail/help/api/get-attachment-content.html) in PHP using CURL. I am able to get the Email Content and Attachment Info (https://www.zoho.com/mail/help/api/get-attach-info.html)
                                                                                                        • Not receiving email from Zoho to active account

                                                                                                          Dear Zoho, I have an account (giahuy@bincorporation.com) can not active to log in zoho. Status: inactive. Please help me to active that account. Thank you very much!
                                                                                                        • What is the reason I can't send emails

                                                                                                          What is the reason I can't send emails?
                                                                                                        • Kiosk Page Refresh

                                                                                                          We have a Kiosk running from a button in contacts to update values and also add related lists, which works great, but when the kiosk is finished the page does not refresh to show the changes. Is there a way to force the contact to refresh/update when
                                                                                                        • Zoho Desk app update - Activities module support

                                                                                                          Hello everyone! In the most recent version of the Zoho Desk Android app, we have brought in support for the 'Activities' module. You can now access activities as a separate module and manage your events, tasks, and calls within the mobile app. Also, you
                                                                                                        • Access invoice custom modules data from API

                                                                                                          Hi, I am using $url = "https://www.zohoapis.eu/invoice/v3/invoices"; $opts = ["http" => [method" => "GET",header" => [ "Authorization: Zoho-oauthtoken $accessToken", "X-com-zoho-invoice-organizationid: $orgId" ] ] ]; From my app to retrieve the invoices,
                                                                                                        • API - Inactive user

                                                                                                          Hi We have a complex flow set up with an API. Yesterday I needed to inactivate a user who had set up the flow and API- realised after this, then broke the connection so - re-activated the user. The flow now seems not to work when gaining information from
                                                                                                        • Creating task at someones date of birth

                                                                                                          Hi, I want to create a workflow which creates a task at someones date of birth. How can I do this?
                                                                                                        • Using lookup field in Formula field

                                                                                                          I created the following formula field to get string output based on Lookup field values Lead and Account: if(${Communications.Lead}!='','Lead',if(${Communications.Account}!='','Account','Other')) The syntax seems correct, but I'm still getting an error.
                                                                                                        • How to associate a document sent in Zoho Sign with an deal in the CRM?

                                                                                                          Hi, often documents are loaded in Zoho sign and sent for signature. These sometimes are linked to a deal in the Zoho CRM and would be nice to see the status of the document within the CRM. I am aware of the integration, but that assumes that the document
                                                                                                        • Inventory valuation

                                                                                                          Inventory valuation in case of sales return makes some error in getting proper value of inventory. Cost price considered for accommodating the goods returned is not the price at which cost of good sold where recorded, last purchase of the same item is
                                                                                                        • Where do we manage tags?

                                                                                                          Where is the page where we can view all tags and manage them (like change a tag name to something else or merge tickets under a particular tag with another)?
                                                                                                        • Google Ads Data is Publicly available in Zoho CRM

                                                                                                          We recently discovered that ALL of the following Google Ads fields are visible to all users in our CRM that have access to either Leads or Contacts modules. Not only is this troubling and inconvenient, it should be unacceptable. It also creates a mess
                                                                                                        • Enhanced duplicate check for Leads in CRM

                                                                                                          Hello Everyone, We are excited to announce that you can now check for duplicate entries in leads by comparing them with similar records in the Contacts Module. Previously, when you added a lead, only the converted leads were checked for duplicates. This
                                                                                                        • Improved record access with the Default Access Level feature

                                                                                                          Greetings, I hope you're all doing well. We're excited to introduce Default Access Levels, which enable you to grant access to your peers' records when necessary. What problem does it solve? Organizations typically have hierarchies wherein higher-level
                                                                                                        • Introducing Assessment-based Filters in Zoho Recruit

                                                                                                          We're thrilled to announce a handy new feature: Filtering Candidates by Assessment Answers. This tool allows you to refine your candidate search based on their performance in screening tests or assessments. It's a great way to find candidates who meet
                                                                                                        • Error sending an email

                                                                                                          Hi, I'm trying to send an automated email (receiver is always the same) via Deluge function. It was working perfectly, but yesterday the receiver's mailbox got full and started returning this error: { "data": [ { "code": "NOT_ALLOWED", "details": { "reason":
                                                                                                        • Next Page