Cross-module record conversion can be mind-numbing if done manually, especially when you’re dealing with a list of records. Don’t you wish that you can convert records from any one module to another in Zoho CRM in a single click of a button like the “Convert” button in Leads? Well, we’ll show you how you can build one that even works for custom modules!
Some of you may think “I don’t need to know this cause I’ll never need to do record conversions”. Before you hit the back button, it might interest you to know that some parts of this article can be useful to you, like how to convert related lists, activities, move attachment, notes and more. While I still have you here, let’s dive in!
Here are some cool ideas on ways you can use the code in Zoho CRM:
Get the necessary fields of the record in the original module (oldModule), then create a record in the destination module (newModule) with a map containing the fields. Get the ID of the new record you have just created for later use. You now have the new record in the new module with all the fields you need copied over.
A conversion is not complete without migrating the related lists.The common related lists on a record are Contacts, Deals, Notes and Activities (Tasks, Events, Calls). This may differ on a case-to-case basis depending on your modules, but here, we will focus on the four.
We migrate related Contacts by getting all related Contacts on the old module. If the related Contact list is not empty, we iterate through each Contact, remove its connection from the old module, then link to the new.
The same is done for related Deals.
We don’t wanna lose any notes about how Joe’s favourite food is sushi now do we? When copying notes, we wanna make sure to copy both the Note Title and the Note Content. Then, we re-create the notes in the new record by sticking the new record ID in the “Parent_Id” and setting the “$se_module” to the new module.
Let’s not lose track of what we are in the midst of doing, going to do, or have already done in the past. “Activities” consists of Tasks, Events and Calls. All Open Activities (current & future) are stored in the “Activities” module. To migrate them to the new record, we need to update certain fields on the related activity records.
Past activities are stored in another module called “Activities History”.
Attachments can be migrated by first downloading them into the function, then uploading to the new record. For both download and upload functions, Zoho CRM API call is needed (that’s where your connection is needed).
Once everything is fully migrated, it’s time to bid farewell to the old record with the delete record API call.
The ability to convert Contacts back to Leads is sought after by many. Since Zoho does not have that functionality yet, we’re gonna build it using the scripts above.
What happens during a Lead Conversion?
In order to convert a Contact back to a Lead, here’s what we need the script to do:
Create a Button for the Function
Learn to create a customized inventory report with Zoho Analytics. This tutorial contains a link to our GitHub page for SQL code that will help with your table creations....
Whether you work primarily out of CRM or the Zoho Finance Suite, you can use Analytics to build commissions dashboards. This involves some fairly simple SQL code....