如何在SugarCRM中将web服务与自定义模块集成?
我正在使用SugarCRM开发一个客户管理软件。我从带有自定义字段的基本模板创建了一个自定义模块。是否可以通过外部web服务摆脱SugarCRM db并执行CRUD操作?实际上,通过设置自定义控制器的bean属性,我能够在datailview中显示web服务数据如何在SugarCRM中将web服务与自定义模块集成?,sugarcrm,sugarbean,Sugarcrm,Sugarbean,我正在使用SugarCRM开发一个客户管理软件。我从带有自定义字段的基本模板创建了一个自定义模块。是否可以通过外部web服务摆脱SugarCRM db并执行CRUD操作?实际上,通过设置自定义控制器的bean属性,我能够在datailview中显示web服务数据 class CustomerController extends SugarController{ public function action_detailview(){ $customer = new Custo
class CustomerController extends SugarController{
public function action_detailview(){
$customer = new Customer();
$customer = getCustomerFromWebService();
$this->bean = $customer;
$this->view = "detail";
}
}
我想对listview做同样的事情,但我不知道如何设置默认listview使用的列表(如果存在)的记录。您可以通过自定义/modules/modulename/views/view.list.php中的view.list.php,使用以下代码更改列表视图:
<?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();
}
}
?>