Results 1 to 8 of 8

Thread: listviewdefs.php

  1. #1
    David1967 is offline Junior Member
    Join Date
    Feb 2009
    Posts
    3

    Default listviewdefs.php

    how do you change the default sort of listviewdefs.php. Under cases i need it to sort by a custom field rather than the case number.

  2. #2
    dipensoni is offline Member
    Join Date
    Aug 2010
    Posts
    7

    Default Re: listviewdefs.php

    i think following link may help you

    http://apps.sugarcrm.com/forums/showthread.php?t=43391

  3. #3
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: listviewdefs.php

    Hello, I would like to be able to do this but the URL does not point to an article anymoee.

    Does anyone know how to do this and which file I need to edit to stipulate which is the default sort field

    Thanks

    Matt

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: listviewdefs.php

    I believe you can set this in Studio in the latest versions but at the very least go to custom/modules/MOD/metadata/listviewdefs.php and set 'orderBy' => 'YOURFIELD', under the column you want default sorted. So to order by title in contacts:
    PHP Code:
        'TITLE' => array(
            
    'width' => '15%'
            
    'label' => 'LBL_LIST_TITLE',
           
    'orderBy' => 'title',
            
    'default' => true), 
    I may have something messed up but that should be the general idea.

  5. #5
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: listviewdefs.php

    Thanks for your reply. I am trying to set the default sort order for the Cases module so that it always sorts by a certain field. I am not sure if the system just remembers the last field you sorted by or not though?

    Cheers

    Matt

  6. #6
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: listviewdefs.php

    Yes sugar records per user (in user preferences) the last sorted column and when the user opens the list again it already is sorted by this column. To recovery the default sorted column is needed to reset users preferences.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  7. #7
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: listviewdefs.php

    That's what I thought

    Thanks everyone

  8. #8
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: listviewdefs.php

    Another way to sort the listview automatically is customizing list.view.php file and adjust the where statment to have the desired order by value.

    Then you can program it to be fixed or to just be flexiable and be set just in some defaut situation.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to use customCode in listviewdefs
    By chemie2008 in forum Developer Help
    Replies: 2
    Last Post: 2009-03-04, 08:33 PM
  2. Add related field to listviewdefs.php
    By Meex21 in forum Developer Help
    Replies: 2
    Last Post: 2009-02-10, 01:45 PM
  3. what variables are available in listviewdefs?
    By hforbess in forum Developer Help
    Replies: 0
    Last Post: 2008-07-08, 10:46 PM
  4. listviewdefs.php
    By gugachiu in forum Developer Help
    Replies: 1
    Last Post: 2008-01-31, 05:06 PM
  5. listviewdefs.php and Smarty
    By gugachiu in forum Developer Help
    Replies: 2
    Last Post: 2008-01-28, 09:22 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
  •