如何在 SugarCRM CE 中创建潜在客户和自定义模块之间的关系?
function createPJOpportunityRelationship($pj_id, $op_id) {
echo "creating relationship";
$set_relationship_value = array(
'module1' => 'geral_pessoa_juridica', 'module1_id' => $pj_id,
'module2' => 'Opportunities', 'module2_id' => $op_id
);
$set_relationship_params = array(
'session' => $this->ses,
'set_relationship_value' => $set_relationship_value
);
$set_relationship_result = $this->soap->call('set_relationship', array(
'session' => $this->ses,
'set_relationship_value' => $set_relationship_value));
var_dump($set_relationship_result);
}
根据大多数糖教程,这是我用来创建关系的代码。当我使用 2 个基本模块(如潜在客户/联系人)时,该代码可以工作,但当我尝试使用自定义构建的模块时,该代码会失败。
在本例中,geral_pessoa_juridica
模块是自定义模块,geral 是包,pessoa_juridica 是名称。我确信这个名字是正确的,它适用于其他功能。
这个函数返回给我这个
5ec9ca75-e09d-e2d8-0c2b-4df7ac377dcf 建立关系 数组(3){ [“已创建”]=>整数(0) [“失败”]=>整数(1) [“已删除”]=>整数(0) 我不确定
为什么它会失败 - 研究 Sugarcrm.log,我发现它甚至没有尝试创建关系。
我重新制作了模块两次,尝试按照我在其他关系中看到的 Sugar 标准手动创建表,刷新 MySQL 权限,在 Sugar 中进行所有可能的修复。我无法重新安装它,因为它正在生产中。
关于如何修复它有什么想法吗?
function createPJOpportunityRelationship($pj_id, $op_id) {
echo "creating relationship";
$set_relationship_value = array(
'module1' => 'geral_pessoa_juridica', 'module1_id' => $pj_id,
'module2' => 'Opportunities', 'module2_id' => $op_id
);
$set_relationship_params = array(
'session' => $this->ses,
'set_relationship_value' => $set_relationship_value
);
$set_relationship_result = $this->soap->call('set_relationship', array(
'session' => $this->ses,
'set_relationship_value' => $set_relationship_value));
var_dump($set_relationship_result);
}
This is the code I'm using to create a relationship, according to most sugar tutorials. The code works when I'm using 2 basic modules (Like Leads/Contacts) but it fails when I try it with custom built modules.
In this case, the geral_pessoa_juridica
module is a custom one, geral being the package and pessoa_juridica the name. I'm sure the name is correct, it works for other functions.
This function returns to me this
5ec9ca75-e09d-e2d8-0c2b-4df7ac377dcf
creating relationship
array(3) {
["created"]=> int(0)
["failed"]=> int(1)
["deleted"]=> int(0)
}
I'm not sure WHY it fails - studying sugarcrm.log, I see it didn't even tried to create the relationship.
I remade the module twice, tried to create the tables manually following the Sugar standard I saw in other relationships, flushed MySQL privileges, did all the repairs possible in Sugar. I can't reinstall it because it's on production.
Any ideas on how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第 5 行有错误:
应该是:
There's an error on line 5:
should instead be:
解决了,或者有点。
Solved, or kinda of.