kratos
kratos

Reputation: 2495

How to override popup list view query(listViewProcess) in SuiteCRM?

I am trying to show the popuplist view for a certain WHERE clause however my code does not seem to get executed?

This is what I have in my custom/MODULE_NAME/views/view.popup.php:

<?php

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

class CustomRegistrationMetaViewPopup extends ViewPopup{

    public function listViewProcess(){

        parent::listViewProcess();

        $this->params['custom_select'] = "select * ";
        $this->params['custom_from'] = "from table ";
        $this->where .= "where condition = 'Verified'";
    }

    function CustomRegistrationMetaViewPopup(){
        parent::ViewPopup();
    }

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

My function never gets called. Any idea?

Upvotes: 1

Views: 1684

Answers (1)

Abdur Rehman
Abdur Rehman

Reputation: 3293

you are trying to override listViewProcess function which is available in listview. Correct place for file is: custom\modules\MODULE_NAME\views\view.list.php

and following is the helping code:

require_once('include/MVC/View/views/view.list.php');
class MODULE_NAMEViewList extends ViewList {

    function listViewProcess() {
        global $current_user;
        $this->params['custom_where'] = ' AND module_name.name = "test" ';

        parent::listViewProcess();
}

}

Upvotes: 1

Related Questions