Hello Everyone. I am new to SuiteCRM and currently stuck trying to figure out a particular customization. I have searched the forum and the web but still couldnāt figure it out as programming is not my forte. Hence, I have opened a new post seeking for help.
In the quotes module, if I click on the Account field, the billing & shipping addresses will auto populate from the Accounts Module.
I have created a custom field PHONE_OFFICE_C and would like to auto populate from the Accounts Module as well (PHONE_OFFICE).
a) I have tried to modify the controller.php (AOS_Quotes) using $bean but it does not work (perhaps my understanding is incorrect).
if (isset($_REQUEST['account_id'])) {
$query = "SELECT * FROM accounts WHERE id = '{$_REQUEST['account_id']}'";
$result = $this->bean->db->query($query, true);
$row = $this->bean->db->fetchByAssoc($result);
$this->bean->billing_account_id = $row['id'];
$this->bean->phone_office_c = $row['phone_office']; // <-----------------
$this->bean->billing_account = $row['name'];
$this->bean->billing_address_street = $row['billing_address_street'];
$this->bean->billing_address_city = $row['billing_address_city'];
$this->bean->billing_address_state = $row['billing_address_state'];
$this->bean->billing_address_postalcode = $row['billing_address_postalcode'];
$this->bean->billing_address_country = $row['billing_address_country'];
$this->bean->shipping_address_street = $row['shipping_address_street'];
$this->bean->shipping_address_city = $row['shipping_address_city'];
$this->bean->shipping_address_state = $row['shipping_address_state'];
$this->bean->shipping_address_postalcode = $row['shipping_address_postalcode'];
$this->bean->shipping_address_country = $row['shipping_address_country'];
b) I have also tried to use ādisplayParamsā but no avail (editviewdefs.php under customs AOS_Quotes). I have used ākeyā => ābillingā, and have tried to use āfield_to_name_arrayā but neither works. Most likely my coding is incorrect as well.
1 =>
array (
'name' => 'phone_office_c',
'label' => 'LBL_PHONE_OFFICE',
'displayParams' =>
array(
'key' => 'billing',
),
//'studio' => 'visible',
//'displayParams' =>
//array(
// 'field_to_name_array' => array(
// 'id' => 'account_id',
// 'name' => 'account_contact',
// 'phone_office' => 'phone_office_c',
//),
//'additionalFields' => array(
// 'phone_office' => 'phone_office_c',
//),
//),
),
Any guidance and correct coding help is greatly appreciated.