【发布时间】:2011-08-01 06:48:00
【问题描述】:
我们有一个网站,当插入/更新记录时,我们会运行脚本来更新 Sugar CRM 帐户模块。
Accounts 模块有一个字段 website_id_c 。当数据库发生插入时,我们将最后一个插入 ID 设置为 Sugar CRM 的 website_id_c 以及要插入的剩余值。
插入脚本如下所示。
$name_value_field=array(
array('name' => 'name','value' => $name),
array('name' => 'primary_contactperson_c','value' => $ownername),
array('name' => 'billing_address_street','value' => $address),
array('name' => 'billing_address_postalcode','value' => $postalcode),
array('name' => 'email1','value' => $email),
array('name' => 'website_id_c','value' => $id_retrieved),
);
if(!empty($sessn_id))
{
$result=$soap->set_entry("Accounts",$name_value_field);
}
这使用 SOAP nusoap 客户端与 Sugar CRM 云进行通信。插入工作正常,也可以更新。
$response = $soap->get_entry_list('Accounts',
array('id'),
"website_id_c='$websiteID'");
$account_id = $response['entry_list'][0]['id'];
但目前我想检索 account_id 以在电子邮件的基础上更新记录。我用 email 更改了字段。但我觉得它存储在其他地方,主地址键存储在 Accounts 模块中。因此,首先我们要从 Email 模块中获取该 id,然后根据此 Email 地址 id 查询 Accounts 模块以获取 Account Values。
$response = $soap->get_entry_list('Accounts',
array('id'),
"email1='email@example.com'");
存储Email地址的模块是什么?我以前没有在 Sugar 上工作过。因此,如果您没有完全理解我,请随时问我。
谢谢
【问题讨论】: