Customize query in popup view

This is a way to customize the SQL queries inside the popup( view.popup.php ) in SugarCRM / SuiteCRM.

Create a file called view.popup.php in \custom\modules\< module >\views with this:

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

class <module>ViewPopup extends ViewPopup{

    public function listViewProcess(){

        parent::listViewProcess();

        $this->params['custom_select'] = " CUSTOM SELECT";
        $this->params['custom_from'] = "CUSTOM FROM";
        $this->where .= " CUSTOM WHERE CONDITION";
    }

    function <module>ViewPopup(){

        parent::ViewPopup();
    }

    function preDisplay(){
        parent::preDisplay();       

    }
}

Note :

Here, <MODULE> means the module name you see in the URL, for example, Contacts, Leads, etc.

Hope you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *