To removes subpanels

I want to remove activities ,history and products subpanel in this image below i am not able to remove in admin panel how can i do this please help thanks.

This looks like suite7

There’s a subpanel file in the module’s directory

If you’re looking at a Contact what you want to do is copy the subpaneldefs.php file to the custom folder
i.e

cp /var/www/html/suitecrm/public/modules/Contacts/metadata/subpaneldefs.php /var/www/html/suitecrm/public/custom/modules/Contacts/metadata/

Edit the file within the custom folder

nano /var/www/html/suitecrm/public/custom/modules/Contacts/metadata/subpaneldefs.php

Comment out the Activities, History and Products sections

Take a look at my subpaneldefs file and you can see where i’ve started and ended comments
subpaneldefs.zip (2.8 KB)

It’s the same logic for any of your modules - copy the subpaneldefs from the respective module (Cases, Contacts, Documents etc) to the custom folder and then edit the custom folder’s file for your changes.

1 Like

Hello,

I am trying to hide a subpanel from the Accounts module. I checked my subpaneldef.php under the Accounts module but I don’t have that particular subpanel.

I could see in the studio account and another module has one-to-many relationship.

What’s wrong? Is there any other way? :melting_face: :upside_down_face:

Step 1: Create a custom File

Go to:

/custom/Extension/modules/Accounts/Ext/Layoutdefs

And create a custom.php file in the directory

Step 2: Add the following lines

<?php unset($layout_defs['Accounts']['subpanel_setup']['leads']); unset($layout_defs['Accounts']['subpanel_setup']['accounts']); unset($layout_defs['Accounts']['subpanel_setup']['products_services_purchased']); ?>

This will remove the “leads”, the “member of…” and the “products and services” subpanels.

Step 3: Run “Repair and Rebuild”

  • which is in Admin→Repair
2 Likes

Hello,

It is not working for me. I tried below code. Also, I did QR&R.

<?php unset($layout_defs['Accounts']['subpanel_setup']['Project']);

Still I could see Projects in the Account’s subpanel.

The module isn’t “Projects” it’s “Project” (I think)

I tried the below code(custom.php) and did QR&R. Still, I could see Project as a subpanel.

<?php unset($layout_defs['Accounts']['subpanel_setup']['Project']); ?>

What’s wrong here?

‘Project’ should be lowercase ‘project’

Okay! I will try that. How to find exact module names in the CRM? I need to hide other subpanels too in different modules.

I just noticed weird thing. I tried it with the ‘project’ and it got hide from the subpanel. But, when I am trying same thing with the custom module, it is not getting hide.

Maybe I am not writing a correct name.

I am trying the below thing.

<?php unset($layout_defs['Accounts']['subpanel_setup']['CustomeModuleName']); ?>

It definately works for custom modules. It’s key to get the name correct. Generally it’s then name of module folder in lowercase.

It can also be the name of the relationship like: accounts_custommodulename

Got it thank you!

I have new problem, now I don’t see any subpanels in the Accounts, even after QR&R.

Do I have to repair anything else too?

I found the issue! It was error in the code, now I could see all the subpanels.