How to hard code the where condition in list view ,basic search,advance search in sugar CE
<p>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 </p>

<p>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 ? </p>

<p>mine version is : <strong>sugarcrm community Version 6.5.23</strong></p>

<p>i followed these links <a href="https://developer.sugarcrm.com/2011/02/28/add-where-clause-for-listview-data-in-sugarcrm/" rel="nofollow noreferrer">https://developer.sugarcrm.com/2011/02/28/add-where-clause-for-listview-data-in-sugarcrm/</a>  and    <a href="https://stackoverflow.com/questions/26797287/search-option-is-removed-after-adding-where-condition-to-list-view-suitecrm-suga">Search option is removed after adding Where condition to list view suitecrm/sugarcrm?</a></p>

<p>so i add this code in <code>sugar/modules/Cases/views</code></p>

<p><strong>view.list.php</strong>  </p>

<pre><code>    &lt;?php


    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once('include/MVC/View/views/view.list.php');
    // 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()
    {
    parent::ViewList();
    }
    /*
    * Override listViewProcess with addition to where clause to exclude project templates
    */
    function listViewProcess()
    {
    // // // $this-&gt;lv-&gt;setup($this-&gt;seed, 'include/ListView/ListViewGeneric.tpl', $this-&gt;where, $this-&gt;params);
    // // // echo $this-&gt;lv-&gt;display();

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

    }
    }
    }

    ?&gt;
</code></pre>

<p>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'"; </p>

<p>please help me out this<br>
Thanks advance </p>