I have a custom module with a listview that includes the Account that it is related to. I added a relate field in my custom module, it added a db field account_id as the foreign key and a non-db field account. The problem is the select statement that is generated when trying to sort by the account has "ORDER BY account" in it. That field does not exist in the database, so I get an error 1054 in the debug log when I try to sort by that column by clicking on it. So either you have to run this query against wherever the non-db fields are stored or add a join into the query on the foreign key and then sort by accounts.name. The problem is I have no idea where to modify those things.
I believe the problem lies in my listviewdefs.php file in \custom\modules\GoTo1_GoToMyPC\metadata\. Here's that file:
There are a few different things in, say, the contacts listviewdefs.php and it seems to be able to sort by Account. Anyone know what would make this behave?Code:$module_name = 'GoTo1_GoToMyPC'; $listViewDefs = array ( $module_name => array ( 'ACCOUNT' => array ( 'width' => '20', 'label' => 'LBL_ACCOUNT', 'module' => 'Accounts', 'id' => 'ACCOUNT_ID', 'link' => true, 'related_fields' => array ( 0 => 'account_id', ), 'default' => true, ), 'NAME' => array ( 'width' => '15', 'label' => 'LBL_NAME', 'default' => true, 'link' => true, ), 'EMAIL' => array ( 'width' => '15', 'label' => 'LBL_EMAIL', 'default' => true, ), 'ACCOUNT_PASS' => array ( 'width' => '10', 'label' => 'LBL_ACCOUNT_PASS', 'default' => true, ), 'ACCESS_CODE' => array ( 'width' => '10', 'label' => 'LBL_ACCESS_CODE', 'default' => true, ), 'ASSIGNED_USER_NAME' => array ( 'width' => '9', 'label' => 'LBL_ASSIGNED_TO_NAME', 'default' => false, 'module' => 'Users', 'id' => 'ASSIGNED_USER_ID', 'link' => true, 'related_fields' => array ( 0 => 'assigned_user_id', ), ), ) );
Thanks,
Ryan


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks