Auto-update multiple fields with same values.

Auto-update multiple fields with same values.

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 :
  1. If the customer only has one phone number, the information in the 'Phone' and 'Mobile' fields could be identical.
  2. If the client uses a single email address, the 'Email' and 'Secondary Email' fields might both have the same information.
  3. 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.
  4. 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 :
  1. Go to Setup > Customization > Modules and Fields > Select the required module > Links and button > +New Button.
  2. Provide the needed details and choose the viewing positioning accordingly. (Preferable - View page)
  3. From the drop-down menu that appears, select Writing Function.
Now for creating a custom function, follow these steps:
  1. Provide a name for the custom function and other essential details.
  2. Click on 'Edit Arguments'.
  3. 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
 mp.put("Mobile",phone);
 //For example 2
 mp.put("Secondary_Email",email);
 //For example 3
 mp.put("Permanent_City",city);
 mp.put("Permanent_Street",street);
 mp.put("Permanent_Country",country);
 mp.put("Permanent_State",state);
 map.put("Permanent_Zip_Code",zipcode);
 //For example 4
 mp.put("Senior_High_School_Details",highschool);
 //Common for all examples
 autoPopulate = zoho.crm.updateRecord("Leads",lead_id.toLong(),mp);
 info mp;
 info autoPopulate;
 return "Fields are populated successfully";
5. Save the changes.
6. Select which profiles will be able to view this button.



Execution :

Example 1 :

Example 2 :

Example 3 :

Example 4 :



Note :

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.
    • Related Articles

    • How can I update the pipeline and stage fields automatically after sending a mass email?

      The pipeline and deal stage can be automatically updated through follow-up actions (field updates) after sending mass emails. When sending the mass email you can select the follow-up action by selecting the trigger for the action (email clicked, ...
    • Types of Custom Fields

      In Zoho CRM, you can add different types of custom fields as per your requirements. These fields will be available to all the users added to your organization's CRM account. Customize Zoho Defined Fields : You can edit, delete and hide some of Zoho ...
    • Marking Personal Fields

      GDPR defines personal data as any information relating to an identified or identifiable natural person (i.e. the data subject). There is a wide range of personal data that includes email addresses, location, mobile numbers, identification numbers, ...
    • Tracking History of Picklist Values

      In every business it is very important to keep track of the updates so that you don't miss out any vital information. Say for example, in sales it's crucial to track the "deal stage" or "lead status" to get an idea of the entire progress or traversal ...
    • Working with Custom Fields

      In Zoho CRM, you can add new fields as per your requirements. These fields will be available to all the users added to your organization's CRM account. Customize Zoho Defined Fields: You can edit, delete and hide some of Zoho defined fields, but note ...