Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: subpanel default order

  1. #1
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default subpanel default order

    Is it possible to change the default order of the data in a subpanel

    You can add a where statement but can you add an order by

    Thanks

  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: subpanel default order

    Hi, mikesolomon

    You can modify the order by editing the file: modules/ModuleName/metadata/subpaneldefs.php
    Modify the keys 'sort_order' and 'sort_by' of the subpanel you want to customize

    Remember that ModuleName refers to name of the module containing the subpanel you want to customize.

    It is a good idea to preserve this file subpaneldefs.php and create a new one into custom/modules/ModuleName/metadata/subpaneldefs.php containing only the modified values, like

    PHP Code:
    <?php
    $layout_defs
    ['Accounts']['subpanel_setup']['opportunities']['sort_order'] = 'ASC';
    $layout_defs['Accounts']['subpanel_setup']['opportunities']['sort_by'] = 'amount';
    ?>
    This sample is for the file modules/Accounts/metadata/subpaneldefs.php, which should be preserved and this modifications saved into custom/modules/Accounts/metadata/subpaneldefs.php

    This code modify the order by and sort order of the subpanel Opportunities under Accounts module.

    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
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: subpanel default order

    Quote Originally Posted by andopes
    Hi, mikesolomon

    You can modify the order by editing the file: modules/ModuleName/metadata/subpaneldefs.php
    Modify the keys 'sort_order' and 'sort_by' of the subpanel you want to customize

    Remember that ModuleName refers to name of the module containing the subpanel you want to customize.

    It is a good idea to preserve this file subpaneldefs.php and create a new one into custom/modules/ModuleName/metadata/subpaneldefs.php containing only the modified values, like

    PHP Code:
    <?php
    $layout_defs
    ['Accounts']['subpanel_setup']['opportunities']['sort_order'] = 'ASC';
    $layout_defs['Accounts']['subpanel_setup']['opportunities']['sort_by'] = 'amount';
    ?>
    This sample is for the file modules/Accounts/metadata/subpaneldefs.php, which should be preserved and this modifications saved into custom/modules/Accounts/metadata/subpaneldefs.php

    This code modify the order by and sort order of the subpanel Opportunities under Accounts module.

    Cheers
    Andre you are a star

    Not sure what I'd do without you

  4. #4
    sidh211 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    126

    Default Re: subpanel default order

    Hi i am using Sugar CE 4.5.1i and installed teams os 3.3d module but when i add users to a team and in users subpanel when i click on Next button i get this error
    SQL Error : The multi-part identifier "teams.id" could not be bound.

    plss help me out

    thanks

    regds
    sid

  5. #5
    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: subpanel default order

    Hi, sidh211

    There is a thread discussion for Teams OS.
    Fell free to post this issue there, I'm sure some one can help you.
    It is a long time since my last contribution on Teams OS.

    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.

  6. #6
    chad.hutchins is offline Sugar Community Member
    Join Date
    May 2007
    Location
    Texas
    Posts
    141

    Default Re: subpanel default order

    andopes,

    Thanks for the code snippet. Although, I can't seem to get it to work with two custom modules, ivr_Machine and ivr_System_Configuration.

    I want to order the name field in my ivr_Machine subpanel, that shows up in the ivr_System_Configuration detail view. Here is the code I have:

    PHP Code:
    <?php 
    $layout_defs
    ['ivr_System_Configuration']['subpanel_setup']['ivr_machine']['sort_order'] = 'ASC'
    $layout_defs['ivr_System_Configuration']['subpanel_setup']['ivr_machine']['sort_by'] = 'name'
    ?>
    I have the file saved in /custom/modules/ivr_System_Configuration/metadata/subpaneldefs.php

    I am using Sugar 5.1.

    Anything you see wrong with my code or file location?

    Thanks!

    -chad

  7. #7
    jasv is offline Sugar Community Member
    Join Date
    Sep 2008
    Posts
    98

    Default Re: subpanel default order

    Hi...

    I'm having the same problem... i got two custom modules as well and i want to change tha order by default field. But custom subpanelsdef.php solution isn't working for me.

    I didn't even find this file (subpaneldefs.php) on the folder modules/MYCUSTOMMODULE/metadata/. But i did find in this file: custom/modules/MYCUSTOMMODULE/Ext/Layoutdefs/layoutdefs.ext.php, what i guess must be on subpaneldefs.php. If i edit it, it works, but this is an auto-generated file so the changes won't last.

    Any suggestions? Thanks in advance.

  8. #8
    robert.blasingame is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    24

    Default Re: subpanel default order

    Thanks for the response.

    I never fold the solution for this one. What I had written above seems like it should have worked, but never did.

    Anyone else run into these issues?

    Thanks again.

  9. #9
    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: subpanel default order

    Hi chad

    The correct location is:

    custom/Extension/modules/ivr_System_Configuration/Ext/Layoutdefs/layoutdefs.ext.php
    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.

  10. #10
    hugoyar is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: subpanel default order

    Hi,
    Using Sugar 5.2, I try to create a layoutdefs.ext.php incustom\Extension\modules\MyModuleName\Ext\Layout defs, but it does nothing. I create the file by copying the existing ModuleTests.php file.

    I try to remove some files into cache directory (all into smarty/template_c) but no more success.

    Any idea ?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SubPanel default sort order
    By Bryan in forum Developer Help
    Replies: 5
    Last Post: 2010-11-29, 12:44 PM
  2. Replies: 3
    Last Post: 2006-10-18, 12:47 AM
  3. SugarCrm 4.0 Patch
    By mgamboa in forum General Discussion
    Replies: 0
    Last Post: 2005-12-21, 04:14 PM

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
  •