Results 1 to 4 of 4

Thread: Order problem

  1. #1
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Order problem

    Hello, a task that I thought would really be easy to accomplish is giving me some headache. I am trying to auto-sort by name (first name) the contact sub-panel that appears on account module. I modify the file AccountForAccounts.php located on custom\modules\Contacts\metadata\subpanels , I add the commands:

    'sort_order' => 'asc',
    'sort_by' => 'first_name',

    but it didnt work. Any tips?
    Regards,

    SugarCRM CE v.5.2.0c
    Windows platform
    MySQL v.5.0.37
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  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: Order problem

    Try to Quick Repair and Rebuild.

    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
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Re: Order problem

    It did not work.

    PHP Code:
    <?php
    // created: 2009-04-13 13:48:19
    $subpanel_layout['list_fields'] = array (
      
    'name' => 
      array (
        
    'name' => 'name',
        
    'vname' => 'LBL_LIST_NAME',
        
    'widget_class' => 'SubPanelDetailViewLink',
        
    'sort_order' => 'asc',
        
    'sort_by' => 'first_name'
        
    'module' => 'Contacts',
        
    'width' => '30%',
        
    'default' => true,
      ),
      
    'title' => 
      array (
        
    'width' => '10%',
        
    'vname' => 'LBL_TITLE',
        
    'default' => true,
      ),
      
    'email1' => 
      array (
        
    'name' => 'email1',
        
    'vname' => 'LBL_LIST_EMAIL',
        
    'widget_class' => 'SubPanelEmailLink',
        
    'width' => '30%',
        
    'sortable' => false,
        
    'default' => true,
      ),
      
    'phone_work' => 
      array (
        
    'name' => 'phone_work',
        
    'vname' => 'LBL_LIST_PHONE',
        
    'width' => '15%',
        
    'default' => true,
      ),
      
    'primary_address_city' => 
      array (
        
    'name' => 'primary_address_city',
        
    'vname' => 'LBL_LIST_CITY',
        
    'width' => '20%',
        
    'default' => true,
      ),
      
    'primary_address_state' => 
      array (
        
    'name' => 'primary_address_state',
        
    'vname' => 'LBL_LIST_STATE',
        
    'width' => '10%',
        
    'default' => true,
      ),
      
    'edit_button' => 
      array (
        
    'vname' => 'LBL_EDIT_BUTTON',
        
    'widget_class' => 'SubPanelEditButton',
        
    'module' => 'Contacts',
        
    'width' => '5%',
        
    'default' => true,
      ),
      
    'remove_button' => 
      array (
        
    'vname' => 'LBL_REMOVE',
        
    'widget_class' => 'SubPanelRemoveButton',
        
    'module' => 'Contacts',
        
    'width' => '5%',
        
    'default' => true,
      ),
      
    'first_name' => 
      array (
        
    'name' => 'first_name',
        
    'usage' => 'query_only',
      ),
      
    'last_name' => 
      array (
        
    'name' => 'last_name',
        
    'usage' => 'query_only',
      ),
    );
    ?>
    Regards,

    SugarCRM CE v.5.2.0c
    Windows platform
    MySQL v.5.0.37
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  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: Order problem

    Quote Originally Posted by leowolff View Post
    Hello, a task that I thought would really be easy to accomplish is giving me some headache. I am trying to auto-sort by name (first name) the contact sub-panel that appears on account module. I modify the file AccountForAccounts.php located on custom\modules\Contacts\metadata\subpanels , I add the commands:

    'sort_order' => 'asc',
    'sort_by' => 'first_name',

    but it didnt work. Any tips?
    Hi Leo

    I believe I just figured out your issue!
    You need to create an extended layoutdefs for Accounts and set these attributes there.
    Remember to Rebuild Extension after accomplish this implementation.

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Advanced Search problem - Order by column
    By jbadrov in forum Developer Help
    Replies: 2
    Last Post: 2010-07-29, 03:18 AM
  2. Dropdown sort order problem on 5.2
    By carlo75 in forum Help
    Replies: 2
    Last Post: 2009-04-17, 06:15 AM
  3. Tab Order
    By rublevka in forum Help
    Replies: 0
    Last Post: 2008-10-07, 09:57 AM
  4. Sort order descending problem FIXED!!!
    By MrPresley in forum General Discussion
    Replies: 60
    Last Post: 2007-08-20, 08:56 AM
  5. Order by bug
    By wagnerbl in forum Help
    Replies: 0
    Last Post: 2005-10-31, 12:11 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
  •