Function-28: Transfer record information from one module to another, based on specific criteria.

Function-28: Transfer record information from one module to another, based on specific criteria.



Welcome back everyone!

Last week, we learnt how to create activities automatically based on specific criteria. This week, let's look at a custom function that lets you transfer record information from one module to another, even for custom modules.

Business scenario:

Custom Modules enable you to create entire modules according to your requirements. You can also define the layout of the record in the module, set up layout rules, customize the fields of a record, set up hyperlinks and buttons, etc. This helps reduce clutter and organize your business information efficiently.

The custom function for today is quite similar to Lead Conversion. The difference is that it performs the conversion task on any modules. For instance, let's say you run a gaming company and have 2 custom modules, named Free Customers and Paid Customers. Set the custom function to automatically transfer the lead information to a record in the Free Customers module after making contact with the lead.

Create a Picklist named "Paid" with options "Yes" and "No". Tie the custom function I'm sharing today to this Picklist - I"ll tell you how to do it - such that the custom function gets invoked if "Yes" is picked. Set the default value to be "No" and leave the record as is if the customer prefers using the free plan. However, if the customer agrees to upgrade to paid plan, update the Picklist as "Yes". This invokes the custom function and moves the record to the Paid Customers module.This takes your business process automation taken to a whole new level.

Include this custom function in a Workflow Rule by setting the condition as "This workflow will be executed whenever the field Paid is updated." Alternatively, set a Custom Button to execute this custom function upon click.

Getting started with the custom function:

Step 1: From Leads to a Custom Module

  • Go to Setup > Automations > Actions > Custom Functions > Configure Custom Function > Write your own.
  • Provide a name for the custom function. For example: “Business Automation - 1”. Add a description(optional).
  • Select the module as Deal. Add a description (optional).
  • Click “Free flow scripting”.
  • Copy the code given below.
  • Click “Edit arguments”.
  • Enter the name as “leadId” and select the value as “Lead Id”.
  • Save the changes.
The script:

Code for Version 2.0 API:

leadIdLong = input.leadId.toLong();
leadDetails = zoho.crm.getRecordById("Leads",leadIdLong);
mp = map();
mp.put("Name",ifnull(leadDetails.get("Full_Name"),""));
mp.put("Annual_Revenue", ifnull(leadDetails.get("Annual_Revenue"),""));
mp.put("Billing_City", ifnull(leadDetails.get("City"),""));
mp.put("Billing_Country", ifnull(leadDetails.get("Country"),""));
mp.put("Description", ifnull(leadDetails.get("Description"),""));
mp.put("Fax", ifnull(leadDetails.get("Fax"),""));
mp.put("Industry", ifnull(leadDetails.get("Industry"),""));
mp.put("Employees", ifnull(leadDetails.get("No_of_Employees"),""));
mp.put("Phone", ifnull(leadDetails.get("Phone"),""));
mp.put("Rating", ifnull(leadDetails.get("Rating"),""));
mp.put("Billing_State", ifnull(leadDetails.get("State"),""));
mp.put("Billing_Street", ifnull(leadDetails.get("Street"),""));
mp.put("Billing_Code", ifnull(leadDetails.get("Zip_Code"),""));
mp.put("Website", ifnull(leadDetails.get("Website"),""));
create = zoho.crm.create("CustomModule1apiname", mp);
info mp;
info create;

Note : Replace 'CustomModule1apiname' with the custommodule's api name.

Code for Version 1.0 API:

leadIdLong = input.leadId.toLong();
leadDetails = zoho.crm.getRecordById("Leads", leadIdLong);
name = ifnull(leadDetails.get("First Name"),"") + " " + ifnull(leadDetails.get("Last Name"),"") ;
mp = map();
mp.put(("CustomModule1 Name"),name );
mp.put("Annual Revenue", ifnull(leadDetails.get("Annual Revenue"),""));
mp.put("Billing City", ifnull(leadDetails.get("City"),""));
mp.put("Billing Country", ifnull(leadDetails.get("Country"),""));
mp.put("Description", ifnull(leadDetails.get("Description"),""));
mp.put("Fax", ifnull(leadDetails.get("Fax"),""));
mp.put("Industry", ifnull(leadDetails.get("Industry"),""));
mp.put("Employees", ifnull(leadDetails.get("No of Employees"),""));
mp.put("Phone", ifnull(leadDetails.get("Phone"),""));
mp.put("Rating", ifnull(leadDetails.get("Rating"),""));
mp.put("Billing State", ifnull(leadDetails.get("State"),""));
mp.put("Billing Street", ifnull(leadDetails.get("Street"),""));
mp.put("Billing Code", ifnull(leadDetails.get("Zip Code"),""));
mp.put("Website", ifnull(leadDetails.get("Website"),""));
create = zoho.crm.create(("CustomModule1"), mp);
info mp;
info create;


Step 2: From one Custom Module to another

  • Go to Setup > Automations > Actions > Custom Functions > Configure Custom Function > Write your own.
  • Provide a name for the custom function. For example: “Business Automation - 2”. Add a description(optional).
  • Select the Custom Module as the module. Add a description (optional).
  • Click “Free flow scripting”.
  • Copy the code given below.
  • Click “Edit arguments”.
  • Enter the name as “CustommoduleId” and select the value as “CustomModule Id”.
  • Save the changes.

The script:

Code for Version 2.0 API:

CustommoduleDetails = zoho.crm.getRecordById("CustomModule1apiname", input.CustommoduleId.toLong());
createMap = map();
createMap.put("Name", ifnull(CustommoduleDetails.get("Name"),""));
createMap.put("Owner", ifnull(CustommoduleDetails.get("Owner"),"").get("id"));
createMap.put("Phone", ifnull(CustommoduleDetails.get("Phone"),""));
createMap.put("Email", ifnull(CustommoduleDetails.get("Email"),""));
createCustomModule = zoho.crm.create("CustomModule2apiname", createMap);
info createMap;
info createCustomModule;

Note : Replace 'CustomModule1apiname' with the custommodule1's api name.
Replace 'CustomModule2apiname' with the custommodule2's api name.

Code for Version 1.0 API:

CustommoduleDetails = zoho.crm.getRecordById("CustomModule1", input.CustommoduleId);
createMap = map();
createMap.put("CustomModule2 Name", ifnull(CustommoduleDetails.get("CustomModule1 Name"),""));
createMap.put("SMOWNERID", ifnull(CustommoduleDetails.get("SMOWNERID"),""));
createMap.put("Phone", ifnull(CustommoduleDetails.get("Phone"),""));
createMap.put("Email", ifnull(CustommoduleDetails.get("Email"),""));
createCustomModule = zoho.crm.create("CustomModule2", createMap);
info createMap;
info createCustomModule;

Adding to a workflow:
  • Go to Setup > Automation > Workflow Rules.
  • Click '+ Create Rule'.
  • Select the Module for which this custom function has to be added and give it a name and a description(optional).
  • Select "On a record action".
  • Select "Field Update" and click on Next.
  • Select the Condition as "Paid".
  • Select the checkbox "Repeat this workflow whenever a record is edited." and Click Next.
  • Choose "Custom Function" from Instant Actions.
  • Select the option "Custom Function" (Created by users from your organization).
  • Select the custom function you just added and click on Configure.
  • Click on "Save and Associate".
  • Save the workflow.

Note:

  • Use the code to transfer information between any two modules. Update the module names in the code accordingly.
  • Similar to "ID" of a record, the "ID" for a Custom Module is "CustomModule1", "CustomModule2", etc, in the order of creation. For instance, if Free Customers is created first and Paid Customers is second. Then ID of Free and Paid Customers is CustomModule1 and CustomModule2 respectively.
  • Create a Custom Field in the 1st module named "Date Created", or any name for that matter. It helps you to keep track of when you made contact with the customer, rather than the date in which the record in the 2nd module was created, which leads to discrepancies. Since the 2 modules are the same, creating this custom field lets you to know when the customer was contacted and when he turned into a "Paid Customer".

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

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

Update: As you must be aware, API V1.0 will be deprecated and support for version 1.0 API will be available only till Dec 31, 2018. Version 1.0 compatible Functions will continue to work until Dec 31, 2019. You're advised to migrated to API Version 2.0 at the earliest. Check this announcement for more. We've updated the post to include the Version 2.0 compatible Function.

    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



                                                            • Sticky Posts

                                                            • 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
                                                            • Function #37: Create a Purchase Order from a Quote

                                                              Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,


                                                            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

                                                                                                            • In arattai received message can't be deleted

                                                                                                              The issue has been noticed in following: arattai app (Android) arattai app (Window) arattai web While the message posted by me may be deleted, the ones received from others can't be. The item <Delete> change to <Report> when the message is a received
                                                                                                            • Market cap

                                                                                                              Market cap formula?? Kaise nikale
                                                                                                            • Zoho Sheet for Desktop

                                                                                                              Does Zoho plans to develop a Desktop version of Sheet that installs on the computer like was done with Writer?
                                                                                                            • Option to Customize Career Site URL Without “/jobs/Careers”

                                                                                                              Dear Zoho Recruit Team, I hope you are doing well. We would like to request an enhancement to the Career Site URL structure in Zoho Recruit. In the old version of the career site, our URL was simply: 👉 https://jobs.domain.com However, after moving to
                                                                                                            • SOME FEATURES ARE NOT IN THE ZOHO SHEET IN COMPARISION TO ZOHO SHEET

                                                                                                              TO ZOHO sir/maam with due to respect i want to say that i am using ZOHO tool which is spreadsheet i want to say that some features are not there in zoho sheet as comparison to MS EXCEL like advance filter and other Features which should be there in ZOHO
                                                                                                            • Auto-upload Creator Files to WorkDrive

                                                                                                              Hi everyone, I’m working on a workflow that uploads files from Zoho Creator to specific subfolders in Zoho WorkDrive, as illustrated in the attached diagram. My Creator application form has two multi-file upload fields, and I want—on successful form submission—to
                                                                                                            • Google enhanced conversions not working

                                                                                                              Hi guys, I've connected Zoho CRM through Google Ads interface with the goal to setup the enhanced conversion tracking in Google Ads. I have to Zoho related conversion goals which you can see in the images below: For the conversion goal above I've setup
                                                                                                            • Need Help to setup plugs along with codeless bot buidler. To send sms OTPs to users via Zoho Voice and to verify it

                                                                                                              Need Help to setup plugs along with codeless bot buidler. To send sms OTPs to users via Zoho Voice and to verify it. I get leads from our website and we need to make sure those are not junk. So we are using proactive chat bot and we need mobile OTPs to
                                                                                                            • Direct Integration Between Zoho Cliq Meetings and Google Calendar

                                                                                                              Dear Zoho Team, We’d like to submit the following feature request based on our current use case and the challenges we’re facing: 🎯 Feature Request: Enable meetings scheduled in Zoho Cliq to be automatically added to the host's Google Calendar, not just
                                                                                                            • 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
                                                                                                            • Zoho Desk - Cannot Invite or Register New User

                                                                                                              Hi who may concern, we encountered a problem that we cannot invite user or the visitor cannot register for a user at all through our help center portal, with the snapshot shown as below and the attachement. It always pops up that "Sorry, Unable to process
                                                                                                            • Zoho sheet

                                                                                                              Unable to share zoho sheet with anyone on internet with editer option only view option is show
                                                                                                            • Allocating inventory to specific SO's

                                                                                                              Is there a way that allocate inventory to a specific sales order? For example, let's say we have 90 items in stock. Customer 1 orders 100 items. This allocates all 90 items to their order, and they have a back order for the remaining 10 items which could
                                                                                                            • Mail and OS

                                                                                                              Jai Hind! Zoho is doing good by creating good software (made in india) on par with other tech giants. 🥰 Suggestion: 1. Whenever we sign up on zoho mail its asking for other mail id. It shouldn't be like that. You should ask general details of a user
                                                                                                            • Personal account created under org account

                                                                                                              Hi there, I am Jayesh. We are using ME Central, and we have an account by the email ID soc@kissht.com.. Now I have created a personal account., jayesh.auti@zohomail.in, accidentally. Can you help me to remove this jayesh.auti@zohomail.in from my organization
                                                                                                            • Add another account

                                                                                                              How to add another mail account to my zoho mail.
                                                                                                            • Recover deleted user

                                                                                                              Hi by mistake i have deleted an added user and his email associated. Please help me recover it thank you.
                                                                                                            • No connection to the server

                                                                                                              Hello! I can't add a new email address to my mailbox because your server is rejecting me. Please help. I took and added a screenshot of this problem Marek Olbrys
                                                                                                            • URGENT: Business Email Disruption – SMTP Authentication Failed

                                                                                                              Dear Zoho Support, I am writing to escalate a critical issue with my business email account: 📧 marek@olbrys.de My domain olbrys.de is fully verified in Zoho (MX, SPF, DKIM, DMARC all valid – green status). I am using the correct configuration: smtp.zoho.eu
                                                                                                            • Emails missing from desktop but visible on phone

                                                                                                              Subject says it all. Windows 11 laptop. Apple phone. all systems up to date.
                                                                                                            • Website Hosting

                                                                                                              Hello, I want to host my domain on Hostinger, and I want my emails to run through Zoho Mail. Please provide me with the SPF record, MX record (Type: TXT), and A record, so that I don’t face any issues with my emails. My website is on Hostinger hosting,
                                                                                                            • Can not search zoho mail after update V.1.7.0

                                                                                                              i can not search mail on to and cc box from attached picture and then search contacts box can't click or use anything. include replay mail too.
                                                                                                            • Urgent Security Feature Request – Add MFA to Zoho Projects Client Portal Hello Zoho Projects Team,

                                                                                                              Hello Zoho Projects Team, We hope you are doing well. We would like to submit an urgent security enhancement request regarding the Zoho Projects Client Portal. At this time, as far as we are aware, there is no Multi-Factor Authentication (MFA) available
                                                                                                            • How to retreive the "To be received" value of an Item displayed in Zoho inventory.

                                                                                                              Hi everyone, We have our own Deluge code to generate a PO according to taget quantity and box quantity, pretty usefull and powerful! However, we want to reduce our quantity to order according to "To be received" variable. Seems like this might not even
                                                                                                            • Add Support for Authenticator App MFA in Zoho Desk Help Center

                                                                                                              Hello Zoho Desk Team, We hope you are doing well. We would like to request an enhancement related to security for the Zoho Desk Help Center (customer portal). Currently, the Help Center supports MFA for portal users via SAML, JWT, SMS authentication,
                                                                                                            • Payment on a past due balance

                                                                                                              Scenario: Customer is past due on their account for 4 months. We suspend their billing in Zoho books. Customer finally logs into the portal and enters a new credit card. We associate that cardwith their subscription, which will permit the card to be used
                                                                                                            • Instant Sync of Zoho CRM Data?

                                                                                                              With how valuable Zoho Analytics is to actually creating data driven dashboards/reports, we are surprised that there is no instant or near instant sync between Zoho CRM and Zoho Analytics. Waiting 3 hours is okay for most of our reports, but there are
                                                                                                            • Kaizen #211 - Answering your Questions | Using Canvas and Widgets to Tailor CRM for Mobile

                                                                                                              Howdy, tech wizards! We are back with the final post in addressing the queries you shared for our 200th milestone. This week, we are focusing on a couple of queries on Zoho CRM mobile configurations and custom payment gateway integration. 1. Mobile SDK
                                                                                                            • Remove "Invalid entries found. Rectify and submit again" modal

                                                                                                              Following up on a post from a few years back, but can the Zoho team consider either removing the 'Invalid entries found. Rectify and submit again' modal that displays for empty mandatory fields OR allow an admin to change it? I've built a custom error
                                                                                                            • Validation function not preventing candidates under 18 or over 30 from submitting the web form

                                                                                                              Hello everyone, I’m trying to create a validation rule for the Candidate Webform in Zoho Recruit. I added a custom field called “Date of Birth”, and I want to make sure that candidates cannot submit the form unless their age is between 18 and 30 years.
                                                                                                            • Remember all the ways we've posted?

                                                                                                              The world celebrates World Postal Day in 2025 with the theme “#PostForPeople: Local Service. Global Reach". The story of the “post” is a story of human connection itself, evolving from simple handwritten notes carried over long distances to instant digital
                                                                                                            • Custom domain issue

                                                                                                              I recently changed records for my support area custom domain for a few months, I then wanted to come back to Zoho, but now I can't connect it and I can't login as it's having an SSL issue. I cannot get a good response from support, as I've been notified
                                                                                                            • Cadence reports as front-end reports

                                                                                                              Hello everyone, We have built a cadence which is connected to the Leads module. There are 11 steps in total, 7 are automatic emails and 4 are tasks for the Lead owners. As admins, we have access to this (very nicely made) 'View Reports' tab where we can
                                                                                                            • Zoho Commerce in multiple languages

                                                                                                              When will you be able to offer Zoho Commerce in more languages? We sell in multiple markets and want to be able to offer a local version of our webshop. What does the roadmap look like?
                                                                                                            • Show elapsed time on the thank-you page?

                                                                                                              Is it possible to display the total time a user spent filling out a Zoho Form on the thank-you? I’d like to show the difference between the `form submission timestamp` and the `start time` (currently have a hidden Date-Time field set to autofill the date
                                                                                                            • The present is a "present"

                                                                                                              The conversation around mental health has been gaining attention in recent years. Even with this awareness, we often feel stuck; the relentless pace of modern life makes us too busy to pause, reflect, and recharge. In the world of customer support, this
                                                                                                            • Kaizen# 209 - Answering Your Questions | All About Client Script

                                                                                                              Hello everyone! Welcome back to another exciting Kaizen post! Thanks for all your feedback and questions. In this post, let's see the answers to your questions related to Client Script. We took the time to discuss with our development team, carefully
                                                                                                            • Email Integration - Zoho CRM - OAuth and IMAP

                                                                                                              Hello, We are attempting to integrate our Microsoft 365 email with Zoho CRM. We are using the documentation at Email Configuration for IMAP and POP3 (zoho.com) We use Microsoft 365 and per their recommendations (and requirements) for secure email we have
                                                                                                            • Search in Zoho Community Not Working

                                                                                                              I realize this is a bit of a meta topic, but the search for the various Zoho Communities appears to not be working. I'm under the impression that they run on some version of the Zoho Desk platform, so I'm posting this here.
                                                                                                            • I need to do crud with snippet html

                                                                                                              I need to implement a form with an improved user interface. I would like to use snippets to build a CRUD that allows me to create and update records. How could I achieve this using snippets?
                                                                                                            • Next Page