SugarCRM Development

Auto Populating The Related Module’s Field Data in The Current Module

We often have a requirement to populate the fields data of the related module on change of the related field in the current module. Let us take an example here. We have a parent-child relationship between the Accounts and Contacts module (one too many relationships). Although SugarCRM’s default address auto-population from Account to Contact is helpful, it doesn’t stop there. We often encounter scenarios where we need to go beyond just addresses and populate other crucial fields from the Account as well.


Let us take an example here:

If we want to populate the data to the Office Phone field in the Contacts module the same as the office phone in the Accounts module. As a result, using the populate_list makes this process simple. It triggers the logic whenever the account is changed in the Contact or linked to it.

Step 1:

Create the file in the below path and add this code../custom/Extension/modules/Contacts/Ext/Vardefs/
$dictionary[‘Contact’][‘fields’][‘account_name‘][‘populate_list’][ ‘phone_work’] = ‘phone_office’;
Let us understand a bit more about the parameters used in this file.

  • account_name refers to the relationship name of the Contacts and Accounts.
  • phone_work is the field name of the Office Phone field in the Contacts module.
  • phone_office is the field name of the Office Phone field in the Accounts module.

This code can be utilize for any type of the field in any module. Make sure we are using the correct relationship names and field names when we are adding the code in the Vardefs.

Step 2:

Make sure you have proper permissions for all your file structure in the Sugar Root Directory. Now we have to perform the Quick Repair and Rebuild by navigating to the admin section in the SugarCRM instance.

Linking an Account to a Contact Record populates the Office Phone field with data from the Account.

Ramya Katram

Recent Posts

How to measure success of trade shows and exhibition participation with SugarCRM

Trade Shows and Exhibition Participation  Manufacturing companies often generate leads and business through trade shows…

2 years ago

Exporting Data from SugarCRM – A Complete Guide

Exporting data from SugarCRM is an essential task for businesses that need to share CRM…

2 years ago

CRM for Google Workspace: Seamless Gmail Integration with SugarCRM

A CRM that works from Google Workspace - SugarCRM integration with Google Workspace Enhance relationships…

2 years ago

SugarCRM Enterprise 14.0 Version: April 2024 Release Highlights

Sugar has introduced exciting features in the latest upgrade for all on-site customers. Let's deep…

2 years ago

What is 360 degree view of the customer or Single Point view of the Customer in CRM terminology

In today’s competitive world, understanding and building strong customer relationships is crucial. Acquiring new customers…

2 years ago

The Importance of Upgrading Your On-Premise/Onsite SugarCRM: Best Practices and Tips

Introduction In the ever-evolving world of Customer Relationship Management (CRM) software, staying current is essential.…

2 years ago