AnsweredAssumed Answered

How to hard code the where condition in list view ,basic search,advance  search in sugar CE

Question asked by jothi s on Oct 11, 2016
Latest reply on Oct 11, 2016 by jothi s

Actually i am new to sugarcrm and zend frame work too .if anything not able to understand my following question means comment here . Now I am go for my query actually .i need to add custom where clause in query .so i followed this one its works only for general list view when i use search or advance search its fetching all values .so how to add HARD CODE the  where condition in search and advance search in case module 


i don't want list the value " where source_c not like 'Social media'";  in general list view and search and advance search how to achieve this ? 


i followed this link 


so i add this code in sugar/modules/Cases/views





if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');


// name of class match module
class CasesViewList extends ViewList{

// where clause that will be inserted in sql query
var $where = "source_c not like 'Social media'";   //this is my where clause 
//var $where = "";


function CasesViewList()

* Override listViewProcess with addition to where clause to exclude project templates
function listViewProcess()


$this->processSearchForm(); // for search form
$this->lv->searchColumns = $this->searchForm->searchColumns;
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
$this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params); // call the listview's file
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']); // save the last search
echo $this->lv->display();





above code is working for general list view only . i need to hard code the where clause in search and advance search too . when i search don't need to list row " where source_c not like 'Social media'";  


Thanks advance