Function #43: Transfer record information from one module to another with subform datas.

Function #43: Transfer record information from one module to another with subform datas.


 

Welcome back everyone!

 

Last week, we learnt how to Organize Contacts based on the Deal Stages. This week, let's look at a custom function that lets you transfer data captured from one module to the other along with the subform data.

 

Business scenario: 

 

The standard sales process involves entering the leads acquired through various channels to the CRM followed by lead qualification and conversion. The process is quite linear - create a lead --> qualify the lead --> convert it to contact --> create an account --> create a deal --> follow up with prospect --> win the deal. However, the sale process need not be linear on all occasions. What if your process involves copying CRM records from one module to the other seamlessly?  Say for instance, you run a gaming company that follows freemium business model. The case involves 2 categories of users namely free and paid. . By default, the free customers are captured in the Leads module. Use the Function I'm sharing today to copy the records from the Leads module to the "Paid Customers" module once the user upgrades to the paid version. The best part is that the code copies not only the data from the standard and custom fields but also the data tracked using the sub-forms. Just need to ensure that the source and destination have the same subform fields and field types.

 

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.


Getting started with the custom function:

  • Go to Setup > Automation > Actions > Functions > Configure Function > Write your own.
  • Provide a name for the custom function. For example: “Create Paid Customer”. Add a description(optional).
  • Select the module as Deal. Add a description (optional).
  • Copy the code given below.
  • Click “Edit arguments”.
  • Enter the name as “leadId” and select the value as “Lead Id”.
  • Save the changes.

 

The Code: 

 

respMap = zoho.crm.getRecordById("Leads",leadId.toLong());

//info respMap;

mp = Map();

mp.put("Name",ifnull(respMap.get("Full_Name"),""));

mp.put("Division",ifnull(respMap.get("Division"),""));

mp.put("Project_Number",ifnull(respMap.get("Project_Number"),""));

mp.put("Customer_Name",ifnull(respMap.get("Account_Name"),""));

mp.put("Exchange_Rate",ifnull(respMap.get("Exchange_Rate"),""));

mp.put("Base_Currency",ifnull(respMap.get("Base_Currency"),""));

mp.put("Billing_Street",ifnull(respMap.get("Billing_Street"),""));

mp.put("Billing_State",ifnull(respMap.get("Billing_State"),""));

mp.put("Billing_Country",ifnull(respMap.get("Billing_Country"),""));

mp.put("Billing_Code",ifnull(respMap.get("Billing_Code"),""));

mp.put("Billing_CIty",ifnull(respMap.get("Billing_City"),""));

sub_forms = List();

subinfo = ifnull(respMap.get("Product_Details"),"");

//info subinfo;

for each rec in subinfo

{

subform = Map();

subform.put("Product",eachProd.get("product").get("id"));

subform.put("Quantity",rec.get("quantity"));

sub_forms.add(subform);

//info sub_forms;

}

mp.put("Product_Details",sub_forms);

create = zoho.crm.create("Paid_Users",mp,{"trigger":["workflow"]});

info create;

 

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's api' 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. 

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! 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!

    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

                                                                                                            • How to notify all members on any updates to zoho crm?

                                                                                                              Hi, I am using the free version of zoho CRM and currently seeing this will work for our company. We are a small company and wanted to be more informed about all the changes in zoho.   1. How do I set notifications that go to the team for any and all changes made in Zoho. At this point, we'd rather be over-informed than under-informed. 2. Create a custom field (or rename an unused field) to be able to capture any "Product Feature Requests" from customers or prospects we're talking to. I have anyone
                                                                                                            • Zoho Mail Desktop App Not Loading + Can’t Manage Multiple Accounts

                                                                                                              Hi everyone, I’ve been having ongoing issues with the Zoho Mail desktop app for the past few weeks. The app starts to load but gives up midway and never actually opens — there’s no error message, it just stops loading. The main reason I use the desktop
                                                                                                            • How can I transfer data from Production to Development environment?

                                                                                                              Hi, I am using Creator V6 and would like to bring all the data in production to the Development and Testing environments? Is there an easy way of doing that or I have to export and import each table?
                                                                                                            • Billing frequency is not displayed correctly.

                                                                                                              Hello There is an issue while displaying the billing frequency on a subscription quote. I am able to activate the subscription details and get this lovely overview: If I am adding a Plan which I charge quarterly, first of all it should be possible to
                                                                                                            • Calling Function via REST API with API Key gives 401 using Zoho Developer

                                                                                                              Hi, I created a couple of functions using the one month trial of Enterprise edition, which I was able to call using the API Key method from Postman and from an external site. Now that my trial has expired, I have created the same functions in the Developer
                                                                                                            • Session Expired

                                                                                                              I constantly get "Session Expired" and need to relogin or close and open the application again. This gets really frustrating during the day. Is this something that can be solved? This really makes me want to leave the app as it is no go to need to reopen
                                                                                                            • Employee type and source translation

                                                                                                              In Zoho People, when I fill in the employee’s information, there is the option to determine the type of employment (employee type) and the hiring source. Both options ALWAYS appear in English. It is extremely inconvenient to deal with poorly translated
                                                                                                            • Sync Issue Between Zoho Notebook Web App on Firefox (PC) and Android App

                                                                                                              Hi Zoho Notebook Community, I'm facing a sync problem with Zoho Notebook. When I use the web version on Mozilla Firefox browser on my PC, I create and save new notes, and I've synced them successfully. However, these new notes aren't showing up in my
                                                                                                            • Request for Clarity on Timeline for True GPT/Zia Auto-Response Capabilities

                                                                                                              I appreciate Zoho’s steady innovation, but I’m concerned that Desk and Zia remain well behind modern AI capabilities. For years, GPT-based tools have been able to generate and send contextual responses, yet Zoho Desk only supports summarization or suggested
                                                                                                            • Notebook audio recordings disappearing

                                                                                                              I have recently been experiencing issues where some of my attached audio recordings are disappearing. I am referring specifically to ones made within a Note card in Notebook on mobile, made by pressing the "+" button and choosing "Record audio" (or similar),
                                                                                                            • Has anyone built a ticket export that allows Help Center users to export the tickets shown in the My Area list they are looking at?

                                                                                                              Hi, We are moving to Zoho Desk soon. Our current support system displays an option in our help center allowing customers to export their Open, Closed, or all tickets based on which list they are looking at. We need to offer the same in Zoho Desk help
                                                                                                            • Two factor authentication for helpdesk users

                                                                                                              The company i work for wants use the helpdesk site in Zoho desk, as a place for their distribution partners to ask question and look for information about our product. The things there is suppose to go up there is somewhat confidential between my company
                                                                                                            • Zoho Desk: Q2 2025 | What's New

                                                                                                              Hello everyone, We are excited to announce Zoho Desk's 2025 Autumn updates. This release brings new features and enhancements that improve work management and enable businesses to provide a better overall support experience. Spanning from Zia Agents to
                                                                                                            • Change text in help desk

                                                                                                              Hi, Please let me know how can i change the this text, see screenshot.
                                                                                                            • Items Below Reorder Point Report?

                                                                                                              Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
                                                                                                            • Blog Widget: Show recent blog posts on my homepage

                                                                                                              Hey there I am using the Zoho Sites Blog feature. On my homepage, on the bottom I'd like to have a featured content section where I show some of my blog posts (selected, most recent, filtered by category and so on...). It would be nice to have a blog
                                                                                                            • Committed Stock and To Be Received Stock via API?

                                                                                                              Is it possible to retrieve Committed Stock and/or To Be Received Stock for an Item via the API? I want to use this information for calculating the amount of inventory needed to be purchased.
                                                                                                            • Zoho Books | Product updates | October 2025

                                                                                                              Hello users, We’ve rolled out new features and enhancements in Zoho Books. From iOS 26 updates to viewing reports as charts, explore the updates designed to enhance your bookkeeping experience. Zoho Books Updates for Apple Devices At WWDC 2025, Apple
                                                                                                            • Improved RingCentral Integration

                                                                                                              We’d like to request an enhancement to the current RingCentral integration with Zoho. RingCentral now automatically generates call transcripts and AI-based call summaries (AI Notes) for each call, which are extremely helpful for support and sales teams.
                                                                                                            • Cannot reject empty expense report

                                                                                                              Hello, We are currently having issues with two empty expense reports where if we try to reject them, either manually or through the REST API, we get error 114016, which says some of the expenses have already been billed and must be removed. I'd appreciate
                                                                                                            • Having Trouble Opening The Candidate Portal

                                                                                                              Recently am having trouble opening the Candidate Portal. It keeps loading but cannot display any widgets. Tried Safari, Chrome and Edge. Non of them work. Please solve the problem ASAP.
                                                                                                            • Checkboxes not adhering to any policy in mail merge - data from CRM

                                                                                                              I want checkboxes to appear depending on whether the checkbox in the CRM module is ticked or not. However, the tickboxes that appear are either ticked or not, but don't correlate to the actual selections in the CRM module. This is is despite updating
                                                                                                            • Items Landed Cost and Profit?

                                                                                                              Hello, we recently went live with Zoho Inventory, and I have a question about the Landed Cost feature. The FAQ reads: "Tracking the landed cost helps determine the overall cost incurred in procuring the product. This, in turn, helps you to decide the
                                                                                                            • CC and/or BCC users in email templates

                                                                                                              I would like the ability to automatically assign a CC and BCC "User (company employee)" into email templates. Specifically, I would like to be able to add the "User who owns the client" as a CC automatically on any interview scheduled or candidate submitted
                                                                                                            • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

                                                                                                              The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Managing addresses
                                                                                                            • Create Contract API Endpoint Unclear "inputfields" Requirements

                                                                                                              Hello, I'm trying to create a Deluge function that accepts inputs from a form in Zoho Creator and creates a barebones contract of a given type. See below for the current code, cleaned of authentication information. // Fetch form data // Hidden field client_name
                                                                                                            • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

                                                                                                              Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
                                                                                                            • Kaizen #46 - Handling Notes through Zoho CRM API (Part 1/2)

                                                                                                              Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss Handling Notes through Zoho CRM API. What will you learn from this post? Notes in Zoho CRM Working with Notes through Notes APIs 1. Notes in Zoho CRM 1a. Why add Notes to records? Notes are a great way to summarize your observations on customer and prospect interactions and outcomes. By saving notes as CRM data, a sales rep will always be able to keep track of how a sale is progressing. To know more about notes in
                                                                                                            • Marketer's Space - Why email marketing matters in ecommerce (and how to get started with Zoho Campaigns)

                                                                                                              Hello Marketers, Welcome to this week's Marketer's space post. Today, we'll discus why email marketing matters in ecommerce businesses. Running an online store is exciting but challenging. If you're running an online store, you've probably experienced
                                                                                                            • Zoho Campaigns Event timestamps do not propagate to Zoho CRM

                                                                                                              We have integrated Zoho CRM and Zoho Campaigns. But when looking at Contact records, the Campaign event data is missing the actual timestamps: especially when a particular email was sent. They're not in the Campaigns related list, and the cannot be found
                                                                                                            • Kaizen #121 : Customize List Views using Client Script

                                                                                                              Hello everyone! Welcome back to another interesting Kaizen post. In this post, we can discuss how to customize List Views using Client Script. This post will answer the questions Ability to remove public views by the super admin in the Zoho CRM and Is
                                                                                                            • Setting default From address when replying to request

                                                                                                              At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com.  The first two are really internal address that should never be seen by the customer and
                                                                                                            • Explore Your Support Reach with Zoho Assist’s Geo Insights

                                                                                                              Understanding where your remote support sessions are happening can help you make smarter decisions, allocate resources effectively, and improve overall customer satisfaction. In this week's Zoho Assist's community post we will be exploring Geo Insights
                                                                                                            • Error when sending emails from Zoho

                                                                                                              Hello, When trying to send an email from Zoho CRM I keep getting the below error: javax.mail.AuthenticationFailedException: 535 5.7.139 Authentication unsuccessful, the user credentials were incorrect. Any support on this will be much appreciated. Thanks,
                                                                                                            • Formatting of text pasted into Zoho documents

                                                                                                              Howdy, I'm a newbie and finding Zoho an improvement to MS Word. Consider yourself hugged. High on my wish list would be plain text cut-and-paste. When pasting text from the web to Zoho, presently Zoho imports the formatting along with the text. This means that every cut-and-paste operation brings in text in a different font, size, or style. Can we have at least the option of importing plain text without formatting (or better yet, is this option already out there?) ... Thanks Helen
                                                                                                            • Add additional features to Zoho Tables

                                                                                                              Zoho Tables is a really great tool, why not add features like diagramming capability into the tool from applications like Draw.io which I believe is open source, you should be able to do wireframes, process flow diagrams, network design, etc. Please note
                                                                                                            • The Social Wall: August 2025

                                                                                                              Hello everyone, As summer ends, Zoho Social is gearing up for some exciting, bigger updates lined up for the months ahead. While those are in the works, we rolled out a few handy feature updates in August to keep your social media management running smoothly.
                                                                                                            • The Social Wall: July 2025

                                                                                                              Hello everyone! July has brought some exciting new updates to Zoho Social. From powerful enhancements in the Social Toolkit to new capabilities in the mobile app, we’ve packed this month with features designed to help you level up your social media presence.
                                                                                                            • Use Zoho Creator as a source for merge templates in Zoho Writer

                                                                                                              Hello all! We're excited to share that we've enhanced Zoho Creator's integration with Zoho Writer to make this combination even more powerful. You can now use Zoho Creator as a data source for mail merge templates in Zoho Writer. Making more data from
                                                                                                            • Tagged problem !!!

                                                                                                              Damn it, we're one of dozens of construction companies in Africa, but we can't link purchasing invoices to projects. Why isn't this feature available?
                                                                                                            • Next Page