Add subpanel Account in Contact

Hi every body, i need your help

Firstly, I try to add the subpanel Account in Contact but it’s not a success.

I copied the file modules/Contacts/metadata/subpaneldefs.php in custom/modules/Contacts/metadata/subpaneldefs.php and I add this :

'accounts' => array(
    			'order' => 5,
    			'module' => 'Accounts',
    			'sort_order' => 'asc',
    			'sort_by' => 'name',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'accounts',
    			'add_subpanel_data' => 'account_id',
    			'title_key' => 'LBL_ACCOUNT',
    			'top_buttons' => array(
    			  		array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    					array('widget_class' => 'SubPanelTopCreateAccountNameButton'),
    					array('widget_class' => 'SubPanelTopSelectAccountButton', 'mode' => 'MultiSelect'),
    					array('widget_class' => 'SubPanelTopSelectButton', 'mode' => 'MultiSelect'),

I did a repair and cleared the cache, but suiteCRM not use my cutom file.
Why my file is not used ? And is it correct to add the subpanel Account in Contacts module as I do with the custom code?

Secondly, is it possible to have juste one line by contact (one by id) in Contact List ? For example, Miss Tessy D. is linked with Account “P… M…” and Account “PM ADMIN” but I would like to see just one line for the contact (if is possible).

Thank you for your help.

You might want to read this for a background:

The contacts/Accounts relationship is a bit special.

Anyway, you need to use the Extension mechanism for what you’re trying to do. See an example here:

1 Like

It works !

I followed the link and adapted with my situation.

I will also read the first link you sent.

Thank you for your help !

I did it in a different way by unmasking what I think is a bug as the custom subpaneldefs.php is not checked.

Have a look here: