SugarCRM Developers on Twitter

add where clause for listview data in SugarCRM

Editor’s Note: This post is republished with permission from the blog of Milos Miric, who is frequent poster in the Sugar forums. Here he addresses a question from a forums post asking about how to have a default filter on listviews.

Hey all, while reading the forum this question came up so here is a way how easily to do it and you can override it in custom folder also, so it will be upgrade safe way.

For the example we want for Accounts listview to show only accounts that name is like ‘htc’

We will create a file in Accounts/views/view.list.php and add the following code: