gpt4 book ai didi

sugarcrm - 如何将 Web 服务与 SugarCRM 中的自定义模块集成?

转载 作者:行者123 更新时间:2023-12-05 01:24:38 28 4
gpt4 key购买 nike

我正在使用 SugarCRM 开发用于客户管理的软件。我从带有自定义字段的基本模板创建了一个自定义模块。是否可以摆脱 SugarCRM db 并通过外部 Web 服务执行 CRUD 操作?实际上,我可以通过设置自定义 Controller 的 bean 属性在 datailview 中显示 Web 服务数据。

class CustomerController extends SugarController{

public function action_detailview(){

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

}

}

我想用listview做同样的事情,但我不知道如何设置默认listview使用的列表(如果存在)的记录。

最佳答案

您可以通过使用以下代码在 custom/modules/modulename/views/view.list.php 中自定义 view.list.php 来更改 ListView :

<?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();
}

}

?>

关于sugarcrm - 如何将 Web 服务与 SugarCRM 中的自定义模块集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28932717/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com