I changed the default column that one of the modules is ordered by. Now I would like to have the order to show up in a specific order. I have created a view.list.php file and placed it in the custom/module/view folder. When I override the listViewPrepare() function to select the column with:
$_REQUEST['orderBy'] = 'table.column';
it works fine. When I change the code to:
$_REQUEST['orderBy'] = "FIELD(table.column, 'value1', 'value2', 'value3', 'value4', 'value5', 'value6', 'value7')"
it does not order by at all.
I have checked the syntax of the order by statement in mysql and it works there but when I insert it into the view.list.php it doesn’t work. I have echoed out the variable and it is in there correctly. I don’t understand why it isn’t working.
thanks
Alex
If you have manually sorted the list view by clicking the up or down arrows on the title of a field, SugarCRM will save this as the last used ordering field and use it the next time you view the list. Try clicking ‘Reset User Preferences’ from your user page.