Ok I figured it out.
So for all people that will look for that :
This is how I added some fields to auto populate from account popup to contact.
In my example, I added the copy of the phone fax and the description.
To add in /custom/account/metadata/popupdefs.php
Why : We want those field to be available (but hidden) in the popup view.
PHP Code:
'PHONE_OFFICE' => array(
'width' => '10',
'label' => 'LBL_LIST_PHONE',
'default' => false
),
//ADD those lines for fax
'PHONE_FAX' => array(
'width' => '10',
'label' => 'LBL_PHONE_FAX',
'default' => false
),
//ADD those lines for description
'DESCRIPTION' => array(
'width' => '10',
'label' => 'LBL_DESCRIPTION',
'default' => false
),
Then, modify the /custom/contact/metadata/editviewdefs.php like this :
PHP Code:
array (
'name' => 'account_name',
'displayParams' =>
array (
'field_to_name_array' => array(
'id' => 'account_id',
'name' => 'account_name',
'billing_address_street' => 'primary_address_street',
'billing_address_city' => 'primary_address_city',
'billing_address_state' => 'primary_address_state',
'billing_address_postalcode' => 'primary_address_postalcode',
'billing_address_country' => 'primary_address_country',
'phone_office' => 'phone_work',
'phone_fax' => 'phone_fax',
'description' => 'description',),
//Comment those lines so you can override the normal function
// 'key' => 'billing',
// 'copy' => 'primary',
// 'billingKey' => 'primary',
// 'additionalFields' => array (
// 'phone_office' => 'phone_work',
// ),
),
),
Bookmarks