AnsweredAssumed Answered

How to change default sort field in list view?

Question asked by Hemant Aseri on Jul 29, 2014
Latest reply on Apr 29, 2015 by Romina Pontiroli
Hi,
Currently in list view of accounts list is sort by Date Created but i want change that date created to a custom field "Birth Date". Can anyone please tell to change the default sort in list view.

Code:
File: custom/modules/Accounts/view/view.list.php

function listViewPrepare() {    if(empty($_REQUEST['orderBy'])) { 
 
$_REQUEST['orderBy'] = strtoupper('birth_date_c');           

$_REQUEST['sortOrder'] = 'desc'; 
        } 
        parent::listViewPrepare(); 
    }
}


Thanks & Regards;

Outcomes