Display subpanel based on field

My insurance agency sells commercial and personal lines insurance (along with life and health), and some questions that are applicable to businesses, or not relevant to home/auto and vise/versa.

I tried making a “commercial Account” to mimic the “account” module, but then email and other things (like renewal calls) don’t properly connect. So, I’m wondering if maybe all types of accounts should be under the “account” module and have the fields and sub panels based on what type of account it is.

Thanks in advance

technically subpanels are relationships between modules, if you created a new module it wont have any subpanels because there are no relationships by default, you need to create them

best regards

1 Like


I guess what I’m looking for is to be able to set an account as either a household or a business. For example, a drop-down, or checkbox, and based on the result have or not have sub panels available.

ie If the drop down selected is “Business” instead of “home/auto”, then maybe a worker’s comp subpanel to enter in employee information. But if a “home/auto” selection is made, the workers comp sub panel doesn’t show up and/or one for a “boat” is displayed to enter in information for that

oh, ok I see, you can achieve this with javascript, to add a custom javascript in editview you need to modify the file suitecrm/custom/modules/{you_module}/metadata/editviewdefs.php and add the next code

'includes' =>
    array (
        0 =>
            array (
                'file' => 'custom/include/your_file.js',

in that file you can show, hide things with javascript, you just need to inspect the elements with your browser to know the ids, I haven’t done it with subpanels but yes with panels in the detailview, let me know if you get stuck in something

best regards

Plz help me!
I need to add javascript file for all pages?

for all modules

[quote=“maks4604590” post=40415]

I found answer in https://suitecrm.com/community/suitecrm-7-0-discussion/5161-i-want-to-include-common-custom-css-and-js-in-suitecrm#19438

1 Like

Hello Sir
I applied same code but its not working i don’t know why is it so Can you please help me ?

Hello sir
If you got the solution please help me also even i am trying to do this but not getting done