4

I'm using SugarCRM to develop a software for customers management. I created a custom module from basic template with custom fields. Is it possible to get rid of SugarCRM db and perform CRUD operations through external web serivices? Actually I was able to show web services data in the datailview by setting the bean property of a custom controller.

class CustomerController extends SugarController{

public function action_detailview(){

        $customer = new Customer();
        $customer = getCustomerFromWebService();
        $this->bean = $customer;
        $this->view = "detail";

    }

}

I would like to do the same thing with listview, but I don't know how set the records of the list (if it exists) used by the default listview.

scatolone
  • 733
  • 1
  • 5
  • 21

1 Answers1

0

You can change list view by customizing view.list.php in custom/modules/modulename/views/view.list.php using following code:

<?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 modulenameViewList extends ViewList{

    // where clause that will be inserted in sql query
    var $where = 'like 'htc'';
    function modulenameViewList()
    {
        parent::ViewList();
    }

    /*
     * Override listViewProcess with addition to where clause to exclude project templates
     */
    function listViewProcess()
    {
            $this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
            echo $this->lv->display();
    }

}

?>
Jatinder Kaur
  • 397
  • 3
  • 22