(NB:- I look after SuiteCRM for the 2 staff here in my company that use it)
Suite - and Sugar before - has always updated the Contacts âPrimary Addressâ fields (about 5 of them), : by pulling fields from the Account they were just moved to: using from Accounts the similar but different named fields: âBilling Addressâ etc
Thereâs a popUp that asks if you are OK with the new values:
I want to add one more field, to be also copied in the same way.
I have looked hard: but canât find how to!
This file shows the mappings between the fields in Accounts and Contacts:
- include/SugarObjects/templates/person/Person.php
public function populateRelatedBean(SugarBean $newBean) {parent::populateRelatedBean($newBean);
if ($newBean instanceof Company) {
$newBean->phone_fax = $this->phone_fax;
$newBean->phone_office = $this->phone_work;
$newBean->phone_alternate = $this->phone_other;
$newBean->email1 = $this->email1;
$this->add_address_streets('primary_address_street');
$newBean->billing_address_street = $this->primary_address_street;
$newBean->billing_address_city = $this->primary_address_city;
$newBean->billing_address_state = $this->primary_address_state;
$newBean->billing_address_postalcode = $this->primary_address_postalcode;
$newBean->billing_address_country = $this->primary_address_country;
$this->add_address_streets('alt_address_street');
$newBean->shipping_address_street = $this->alt_address_street;
$newBean->shipping_address_city = $this->alt_address_city;
$newBean->shipping_address_state = $this->alt_address_state;
$newBean->shipping_address_postalcode = $this->alt_address_postalcode;
Iâve added a new field mapping there: but the new mapping does not happen âŚ
Looking further - other files also map address fields of both modules: (a) accounts (âbilling_address_..â) and (b) contacts (primary_address_âŚâ)
Do I need to add my new mapping to some or all of those files also? eg
- include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php
$additionalFormFields = array();
if (isset($defines[âfocusâ]->billing_address_street)) {
$additionalFormFields[âprimary_address_streetâ] = $defines[âfocusâ]->billing_address_street;
- include/SugarObjects/templates/person/Person.php
if ($newBean instanceof Company) {
$newBean->phone_fax = $this->phone_fax;
$newBean->phone_office = $this->phone_work;
$newBean->phone_alternate = $this->phone_other;
$newBean->email1 = $this->email1;
$this->add_address_streets(âprimary_address_streetâ);
Some files: include both account and contact address fields, but donât map them together:
- include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php
$additionalFormFields = array();
if (isset($defines[âfocusâ]->billing_address_street)) {
$additionalFormFields[âprimary_address_streetâ] = $defines[âfocusâ]->billing_address_street;
- modules/Accounts/AccountFormBase.php
<input type='hidden' name='{$prefix}billing_address_street' value='{$contact->primary_address_street}'>....
Other research:
The boiler-plate text in the popup (âThis record currently containsâ) is defined as this Label:
- language/en_us.lang.php: âNTC_OPPORTUNITY_REQUIRES_ACCOUNTâ
That label is found in these files:
- include/javascript/sugar_3.js
- include/javascript/quicksearch.js
- include/javascript/popup_helper.js
- include/language/en_us.lang.php
- jssource/src_files/include/javascript/sugar_3.js
- jssource/src_files/include/javascript/quicksearch.js
- jssource/src_files/include/javascript/popup_helper.js
ButâŚ. none of those files seems to make a visible change in the PopUp, when adding some RANDOM_TEXT to display. Eg nothing visible changes after R&R, if I change in jssource/src_files/include/javascript/sugar_3.js
4610 else if (confirm(SUGAR.language.get(âapp_stringsâ, âNTC_OVERWRITE_ADDRESS_PHONE_CONFIRMâ) + â\n\nâ + label_data_str)) {
4611 set_return_basic(popup_reply_data, /\S/);
4612 }
change line 4610 to include âmy 'RANDOM TEXTââ
else if (confirm(SUGAR.language.get(âapp_stringsâ, âNTC_OVERWRITE_ADDRESS_PHONE_CONFIRMâ) + â\n\nâ + 'my RANDOM TEXT' + label_data_str)) {
Also nothing happens if I make a similar change in the other 5 JS files above.




