我正在尝试更新来自 Sugar CRM 的特定潜在客户。我不知道此潜在客户的 ID,因此我尝试通过使用电子邮件地址或姓名调用 get_entry_list 来检索潜在客户 ID。我想使用查询并指定电子邮件地址或名称,如下所示:
'query' => "first_name = \"Bob\"",
我什至尝试过:
'query' => "first_name LIKE \"%Bob%\"",
和
'query' => "email1 LIKE \"%bob@abc.com\"",
但我只是得到这个结果:
Database failure. Please refer to sugarcrm.log for details.
...而且sugarcrm.log里面什么都没有:(
这是完整的代码:
$get_entry_list_parameters = array(
//session id
'session' => $session_id,
//The name of the module from which to retrieve records
'module_name' => 'Leads',
//The SQL WHERE clause without the word "where".
'query' => "first_name = \"Bob\"",
//The SQL ORDER BY clause without the phrase "order by".
'order_by' => "",
//The record offset from which to start.
'offset' => '0',
//Optional. A list of fields to include in the results.
'select_fields' => array(
'id',
'name',
'email1',
),
'link_name_to_fields_array' => array(
),
//The maximum number of results to return.
'max_results' => '10',
//To exclude deleted records
'deleted' => '0',
//If only records marked as favorites should be returned.
'Favorites' => false,
);
$get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url);
echo '<pre>';
print_r($get_entry_list_result);
echo '</pre>';
编辑:我正在使用 v4_1 REST API