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.
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.
i think following link may help you
http://apps.sugarcrm.com/forums/showthread.php?t=43391
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
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:
I may have something messed up but that should be the general idea.PHP Code:'TITLE' => array(
'width' => '15%',
'label' => 'LBL_LIST_TITLE',
'orderBy' => 'title',
'default' => true),
Co-Founder of: SugarOutfitters
Modules:
SecuritySuite (Teams)
Photo Module
Follow me on Twitter:eggsurplus
Your Personal Developer
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
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
That's what I thought
Thanks everyone
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks