Skip to product menu
Zoho crm
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content
Zoho crm

Copy lead information into contacts during conversion

Get your lead's fields, notes, attachments, activities, and custom related lists data copied into its contact during conversion.

It's a common practice to collect as much information as possible while engaging with your leads. This information gets stored in custom fields, notes, attachments, activities, and standard or custom related lists within your CRM account. When you convert a lead, all of this contextual information must be carried over into its corresponding contact, account, and deal records. However, Zoho CRM's lead conversion process only allows you to carry over a lead's standard, custom field values, and standard related lists, but not the additional information added in the custom related lists. To learn more about standard conversion mapping, refer to Converting Leads.

Using functions, you can convert leads and transfer all important information to their corresponding contact records with the click of a button. You can add this button to the Leads detail view page in any preferred order.

Permissions and availability

  • Users with the Manage Extensibility permission can create connections and write custom functions.
  • Users with the Modules Customization permission can create custom buttons.
  • Users with the Manage Sandbox permission can manage the sandbox.

Requirements

  • Create a Zoho OAuth connection with all the scopes for your Zoho CRM account, as detailed in the "Create Connection" section below. Learn more
  • Create and link the button with the custom function, as detailed in the "Create Button" section below. Learn more
  • Test the function in a sandbox before deploying it in your production environment. Learn more

Create a connection

Follow the steps below to create an OAuth connection in your Zoho CRM account:

  1. Go to Setup > Developer Space > Connections.
  2. Click Create Connection.
  3. Select Zoho OAuth under Default Services.
  4. Specify a Connection Name.
    You must enter this name in the code snippet below.
  5. Select the following Scopes to request access.
    • ZohoCRM.modules.all
    • ZohoCRM.modules.attachments.all Learn more
  6. Click Create and Connect.
  7. Click Connect and then click Accept to confirm authorization of access for the scopes requested by the client.

Create a button

Follow the steps below to create a custom button in your Zoho CRM account:

  1. Go to Setup > Customization > Modules and Fields > Leads > Buttons > Create New Button.
  2. Provide a name for the button. For example: "Copy lead info upon conversion".
    Add a description (optional).
  3. Choose the layout(s) you want the button to be placed.
  4. Specify the button's placement as In Record and its position on the page as Details.
  5. Select the action to be performed as Writing Function.
  6. Provide a name and display name for the function and click Create.
  7. In the Deluge script editor, do the following:
    1. Copy and paste the code provided below.
    2. Click Edit Arguments.
    3. Enter the name as leadId and select the value as Leads - Lead Id.
    4. Save the function.
  8. Select the profiles who can view this custom button.
  9. Click Save.

The code

Code Copied
leadIdLong = input.leadId.toLong();
leadDetails = zoho.crm.getRecordById("Leads", leadIdLong);
AcccountMap = map();
AcccountMap.put(("Account_Name"), ifnull(leadDetails.get("Company"),""));
AcccountMap.put("Annual_Revenue", ifnull(leadDetails.get("Annual_Revenue"),""));
AcccountMap.put("Billing_City", ifnull(leadDetails.get("City"),""));
AcccountMap.put("Billing_Country", ifnull(leadDetails.get("Country"),""));
AcccountMap.put("Description", ifnull(leadDetails.get("Description"),""));
AcccountMap.put("Fax", ifnull(leadDetails.get("Fax"),""));
AcccountMap.put("Industry", ifnull(leadDetails.get("Industry"),""));
AcccountMap.put("Employees", ifnull(leadDetails.get("No_of_Employees"),""));
AcccountMap.put("Phone", ifnull(leadDetails.get("Phone"),""));
AcccountMap.put("Rating", ifnull(leadDetails.get("Rating"),""));
AcccountMap.put("Billing_State", ifnull(leadDetails.get("State"),""));
AcccountMap.put("Billing_Street", ifnull(leadDetails.get("Street"),""));
AcccountMap.put("Billing_Code", ifnull(leadDetails.get("Zip_Code"),""));
AcccountMap.put("Website", ifnull(leadDetails.get("Website"),""));
AccountCreate = zoho.crm.create(("Accounts"), AcccountMap);
info AccountCreate;
newaccountId = AccountCreate.get("id");
ContactMap = map();
ContactMap.put("First_Name", ifnull(leadDetails.get("First_Name"),""));
ContactMap.put("Last_Name", ifnull(leadDetails.get("Last_Name"),""));
ContactMap.put("Mailing_City", ifnull(leadDetails.get("City"),""));
ContactMap.put("Mailing_Country", ifnull(leadDetails.get("Country"),""));
ContactMap.put("Mailing_State", ifnull(leadDetails.get("State"),""));
ContactMap.put("Mailing_Street", ifnull(leadDetails.get("Street"),""));
ContactMap.put("Mailing_Zip", ifnull(leadDetails.get("Zip_Code"),""));
ContactMap.put("Description", ifnull(leadDetails.get("Description"),""));
ContactMap.put("Fax", ifnull(leadDetails.get("Fax"),""));
ContactMap.put("Title", ifnull(leadDetails.get("Title"),""));
ContactMap.put("Email", ifnull(leadDetails.get("Email"),""));
ContactMap.put("Lead_Source", ifnull(leadDetails.get("Lead_Source"),""));
ContactMap.put("Mobile", ifnull(leadDetails.get("Mobile"),""));
ContactMap.put("Phone", ifnull(leadDetails.get("Phone"),""));
ContactMap.put("Secondary_Email", ifnull(leadDetails.get("Secondary_Email"),""));
ContactMap.put("Skype_ID", ifnull(leadDetails.get("Skype_ID"),""));
ContactMap.put("Twitter", ifnull(leadDetails.get("Twitter"),""));
ContactMap.put("Account_Name", newaccountId);
ContactCreate = zoho.crm.create("Contacts", ContactMap);
info ContactCreate;
newcontactId = ContactCreate.get("id");
PotentialMap = map();
PotentialMap.put("Deal_Name", ifnull(leadDetails.get("Full_Name"),""));
PotentialMap.put("City", ifnull(leadDetails.get("City"),""));
PotentialMap.put("Country", ifnull(leadDetails.get("Country"),""));
PotentialMap.put("State", ifnull(leadDetails.get("State"),""));
PotentialMap.put("Street", ifnull(leadDetails.get("Street"),""));
PotentialMap.put("Zipcode", ifnull(leadDetails.get("Zip_Code"),""));
PotentialMap.put("Description", ifnull(leadDetails.get("Description"),""));
PotentialMap.put("Lead_Source", ifnull(leadDetails.get("Lead_Source"),""));
PotentialMap.put("Account_Name",newaccountId );
PotentialMap.put("Contact_Name",newcontactId );
PotentialCreate = zoho.crm.create("Potentials", PotentialMap);
info PotentialCreate;
newdealId = PotentialCreate.get("id");
// Copy related notes
RelatedNotes = zoho.crm.getRelatedRecords("Notes", "Leads", leadIdLong);
for each note in RelatedNotes
{
notemap = Map();
notemap.put("Parent_Id",newcontactId);
notemap.put("Note_Content",note.get("Note_Content"));
notemap.put("Note_Title",ifnull(note.get("Note_Title"),""));
notemap.put("se_module","Contacts");
notecreate = zoho.crm.create("Notes",notemap);
notemap1 = Map();
notemap1.put("Parent_Id",newaccountId);
notemap1.put("Note_Content",note.get("Note_Content"));
notemap1.put("Note_Title",ifnull(note.get("Note_Title"),""));
notemap1.put("se_module","Accounts");
notecreate1 = zoho.crm.create("Notes",notemap1);
notemap2 = Map();
notemap2.put("Parent_Id",newdealId);
notemap2.put("Note_Content",note.get("Note_Content"));
notemap2.put("Note_Title",ifnull(note.get("Note_Title"),""));
notemap2.put("se_module","Deals");
notecreate2 = zoho.crm.create("Notes",notemap2);
}
// Copy activities
reltasks = zoho.crm.getRelatedRecords("Tasks","Leads",leadIdLong);
for each task in reltasks
{
taskmap = Map();
taskmap.put("What_Id",newaccountId);
taskmap.put("$se_module","Accounts");
taskmap.put("Who_Id",newcontactId);
updatetask = zoho.crm.update("Tasks",task.get("id"),taskmap);
info updatetask;
}
relevents = zoho.crm.getRelatedRecords("Events","Leads",leadIdLong);
for each events in relevents
{
eventmap = Map();
eventmap.put("What_Id",newaccountId);
eventmap.put("$se_module","Accounts");
eventmap.put("Who_Id",newcontactId);
updateevent = zoho.crm.update("Events",events.get("id"),eventmap);
info updateevent;
}
relcalls = zoho.crm.getRelatedRecords("Calls","Leads",leadIdLong);
for each call in relcalls
{
callmap = Map();
callmap.put("What_Id",newaccountId);
callmap.put("$se_module","Accounts");
callmap.put("Who_Id",newcontactId);
updatecall = zoho.crm.update("Calls",call.get("id"),callmap); 
info updatecall;
}
// Copy attachment
relatedrcords = zoho.crm.getRelatedRecords("Attachments","Leads",leadIdLong);
attachid = List();
for each ele in relatedrcords
{
attachementId = ele.get("id");
attachid.add(attachementId);
}
for each ele in attachid
{
downloadFile = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/Leads/" + leadId + "/Attachments/" + ele
type: GET
connection : "connectionname"
];
resp = zoho.crm.attachFile("Contacts",newcontactId,downloadFile); 
info resp; 
resp1 = zoho.crm.attachFile("Accounts",newaccountId,downloadFile); 
info resp1; 
resp2 = zoho.crm.attachFile("Deals",newdealId,downloadFile); 
info resp2; 
}
// Copy related list
relateddetails = zoho.crm.getRelatedRecords("Client_Products","Leads",leadIdLong);
for each record in relateddetails
{
updatemap = Map();
updatemap.put("xxxxxx",newcontactId);
updatemap.put("yyyyyyy",newaccountId);
updatemap.put("zzzzzzzzz",newdealId);
customupdate = zoho.crm.updateRecord("customname", record.get("id"), updatemap);
info customupdate;
}
return "";

Notes

  • Replace 'connectionname' with the name of the connection.
  • Replace 'xxxxxx' with the custom module's Contact LookUp Field API name.
  • Replace 'yyyyyyy' with the custom module's Account LookUp Field API name.
  • Replace 'zzzzzzzzz' with the custom module's Deal LookUp Field API name.
  • Replace 'customname' with the custom module's API name.
  • You can remove unnecessary code snippets related to the data you don't want to copy.

Tip

  • Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.

Test the solution

  1. Click the Leads tab.
  2. Open the lead record that needs to be converted and click the new button you added to the top-right area.
  3. The lead will be converted into an account and contact.
  4. See whether the lead information—such as custom fields, notes, attachments, activities, and related lists—are transferred to the contact and account.
    Note: You must map the custom fields in the Leads module to the fields in the account and contact to transfer their information to it. Learn more

Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.

More info

  • ModuleLeads
  • Trigger PointCustom Button
  • EditionEnterprise and above
  • ComplexityHigh
  • Implementation Time60 minutes

Features used in the solution

ConnectionCustom ButtonDeluge ScriptSandbox
Story Image

Looking for a custom solution?

Contact us, we will help enhance your productivity at lightning speed.

SUBMIT REQUEST

Developers: Share your solution with our community!

Can't find what
you're looking for?

Let us know what you need - we're happy to help!

REQUEST A CALLBACK
CRM popup character Image