Results 1 to 6 of 6

Thread: Hide Panel based on Account Type

  1. #1
    raky is offline Junior Member
    Join Date
    Mar 2011
    Posts
    4

    Default Hide Panel based on Account Type

    Hi All,

    I'm currently on sugarCRM 6.1 and have had troubles attempting to hide a custom panel which I have made based on the Account Type. Ultimately what I'm trying to do is only display a certain panel and its fields when the Account Type = Customer. Everything else should have the panel hidden.

    I don't believe that DevToolKit works with 6.1 - if it does I have failed miserably at attempting to get it to work. I've tried some other things such as looking into the detailviewdefs.php and attempting to use something like:

    dependency =>

    The issue is that I am not sure what comes after that? How do I specify something like:

    dependency => account_type='Customer'

    I am lost and require assistance!

    Any help would be greatly appreciated.

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hide Panel based on Account Type

    Please, provide zipped custom/modules/Accounts/ folder

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    raky is offline Junior Member
    Join Date
    Mar 2011
    Posts
    4

    Default Re: Hide Panel based on Account Type

    As requested the .zip has been provided.

    What I am attempting to do at the moment is:

    Hide the following panel - 'lbl_detailview_panel1' when the account_type is != 'Customer'.

    Thanks very much for your help.
    Attached Files Attached Files

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hide Panel based on Account Type

    Create the script custom/modules/Accounts/metadata/toogle_panel_fields.php containing a code like that:

    PHP Code:
    <?php
    $toggle_panel_fields 
    = array(
        
    'account_type' => array(
            
    // setup here all options but 'Customer'
            
    'opt1' => array(
                
    'lbl_detailview_panel1' => 0,
            ),
            
    'opt2' => array(
                
    'lbl_detailview_panel1' => 0,
            ),
            
    'opt3' => array(
                
    'lbl_detailview_panel1' => 0,
            ),
            
    'opt4' => array(
                
    'lbl_detailview_panel1' => 0,
            ),
            
    'opt5' => array(
                
    'lbl_detailview_panel1' => 0,
            ),
        ),
    );
    ?>
    Create the custom/modules/Accounts/views/view.detail.php according to User Guide.

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    raky is offline Junior Member
    Join Date
    Mar 2011
    Posts
    4

    Default Re: Hide Panel based on Account Type

    Hi Andre,

    Thank you very much for your help.

    I created the view.detail.php as mentioned above and copied it directly from the User Guide.

    I then populated the toggle_panel_fields.php with the following:

    Code:
    <?php
    $toggle_panel_fields = array(
        'account_type' => array(
            // setup here all options but 'Customer'
    	'Prospect' => array(
                'lbl_detailview_panel1' => 0,
            ),
            'Integrator' => array(
                'lbl_detailview_panel1' => 0,
            ),
            'Referrer' => array(
                'lbl_detailview_panel1' => 0,
            ),
            'Analyst' => array(
                'lbl_detailview_panel1' => 0,
            ),
            'Competitor' => array(
                'lbl_detailview_panel1' => 0,
            ),
           'Investor' => array(
                'lbl_detailview_panel1' => 0,
            ),
           'Partner' => array(
                'lbl_detailview_panel1' => 0,
            ),
           'Press' => array(
                'lbl_detailview_panel1' => 0,
            ),
           'Reseller' => array(
                'lbl_detailview_panel1' => 0,
            ),
           'Other' => array(
                'lbl_detailview_panel1' => 0,
            ),
        ),
    );
    ?>
    I then ran a repair/rebuild. Upon doing this even though nowhere have I specified 'Customer' above the panel is hidden when the account_type is 'Customer' as well.

    I even tried adding to the above with:

    Code:
           'Customer' => array(
                'lbl_detailview_panel1' => 1,
            ),
    I placed this as the first line of code with all the other definitions below it. When I did this the Panel was now visible for all account_type even when they were set to 0.

    Have I messed something up?

  6. #6
    raky is offline Junior Member
    Join Date
    Mar 2011
    Posts
    4

    Default Re: Hide Panel based on Account Type

    I've tried multiple combination's and none appear to work.

    At the moment I have the following in toggle_panel_fields.php:

    Code:
    <?php
    $toggle_panel_fields = array(
        'account_type' => array(
    	'Prospect' => array(
                'lbl_detailview_panel1' => 0,
            ),
        ),
    );
    ?>
    This specifics that only when the Account Type = "Prospect" that the panel should be hidden. However, the Panel is hidden on all Account Types.

    I am wondering if this is a bug that has to do with 6.1? Has anyone else run into this issue?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Layouts based on Account Type
    By robh71 in forum Help
    Replies: 5
    Last Post: 2010-07-20, 01:33 PM
  2. DevToolKit hide panel based on field value
    By kinshibuya in forum Help
    Replies: 1
    Last Post: 2010-03-19, 07:31 PM
  3. Hide panel in detail view based on user role
    By mailfrd in forum Developer Help
    Replies: 3
    Last Post: 2009-06-17, 06:54 PM
  4. hide panel based on role
    By sugar987 in forum Developer Help
    Replies: 1
    Last Post: 2009-05-12, 11:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •