user3286692
user3286692

Reputation: 383

Customize select option on subpanel in SuiteCrm

I wanted to know if there's a way to customize the select option from the subpanel men in Suitecrm.

All one-to-many relationships for a module's subpanel are to be removed whereas for many to many need to rename it to "Associate Module 1 to Module 2 ".

Can I achieve this and this is to be done for all modules.

Upvotes: 2

Views: 1269

Answers (1)

Abdur Rehman
Abdur Rehman

Reputation: 3293

To remove buttons:

Assume that Target module and Lead module has one to many Relationshipship. Now Leads will be shown under the Traget Record Detailview. So if we want to remove selection and creation of Lead from Subpanel of Lead. Then we can hide this two buttons from following code:

Find The relation ship file in

custom/Extension/modules/Prospects/Ext/Layoutdefs/prospects_leads_1_Prospects.php

Remove Commented code as commented in this relationship code as Below, And then Repair and Rebuild.

$layout_defs[“Prospects”][“subpanel_setup”][‘prospects_leads_1’] = array (
‘order’ => 100,
‘module’ => ‘Leads’,
‘subpanel_name’ => ‘default’,
‘sort_order’ => ‘asc’,
‘sort_by’ => ‘id’,
‘title_key’ => ‘LBL_PROSPECTS_LEADS_1_FROM_LEADS_TITLE’,
‘get_subpanel_data’ => ‘prospects_leads_1’,
‘top_buttons’ =>
array (

/*
0 =>
array (
‘widget_class’ => ‘SubPanelTopButtonQuickCreate’,
),
1 =>
array (
‘widget_class’ => ‘SubPanelTopSelectButton’,
‘mode’ => ‘MultiSelect’,
),
*/

),

);

moreover, you can check labelvalue and then change label in language file accordingly.

To Rename button at system level: Place following language label in custom/include/language/en_us.lang.php

$GLOBALS['app_strings']['LBL_SELECT_BUTTON_LABEL'] = 'your label'; 

This will change the label for all but if you want to change it via some logic then see file: include\generic\SugarWidgets\SugarWidgetSubPanelTopSelectButton.php, it has public function getDisplayName() where you can add some logic to change that label in a specific condition. Hopefully, you will write that logic your own. Also, you can return empty html in those cases where you don't need button.

Upvotes: 1

Related Questions