When you consider the data that you add in Zoho CRM, many a time you may want to enter the same value for two different fields in a record.
Some of these scenarios are as follows :
- If the customer only has one phone number, the information in the 'Phone' and 'Mobile' fields could be identical.
- If the client uses a single email address, the 'Email' and 'Secondary Email' fields might both have the same information.
- We have two separate sections in several CRM forms, such as the 'Address' field and the 'Permanent address' field. In the vast majority of cases, they are identical.
- Consider a form that contains information about a person's educational background. If the contact information prompts you to enter the address of the institution under the Bachelors' and Masters' sections, and you wish to enter the same address in both sections, doing so manually is tiring. It will be simpler if the values are automatically populated.
All the above - mentioned specific scenarios can be achieved in Zoho CRM by using custom functions. Initially, a button is created and the custom function is integrated within the button. Once the button is clicked, the actions written in the custom function gets triggered accordingly.
Step for creating a button :
- Go to Setup > Customization > Modules and Fields > Select the required module > Links and button > +New Button.
- Provide the needed details and choose the viewing positioning accordingly. (Preferable - View page)
- From the drop-down menu that appears, select Writing Function.
Now for creating a custom function, follow these steps:
- Provide a name for the custom function and other essential details.
- Click on 'Edit Arguments'.
- Based on the examples map the required parameters. Module ID mapping is common for all the examples.
For example 1 : Similar contact number
Enter the name as phone and select the value from the desired module.
For example 2 : Similar email address
Enter the name as email and select the value from the desired module.
For example 3 : Similar address
Enter the mapping name for all the fields in the address and select the value from the desired module.
For example 4 : Similar institution
Enter the name as institution and select the value from the desired module.
4. Now, type the code given below.
mp = Map();
//For example 1
//For example 2
//For example 3
//For example 4
//Common for all examples
autoPopulate = zoho.crm.updateRecord("Leads",lead_id.toLong(),mp);
return "Fields are populated successfully";
5. Save the changes.
6. Select which profiles will be able to view this button.
Example 1 : Example 2 : Example 3 :
Example 4 :
This function is already available in the Quotes module. Furthermore, they can transfer data in both directions. That is, information from field 'A' can be moved to field 'B,' and vice versa.
To implement a similar function in Leads, Contacts and any other module of your choice, the above function will be helpful.