我的代码如下.. 请注意,我正在尝试检索Accounts.name =' bhagya'所在的所有帐户。 同样的查询在SugarCRM Version 6.5(社区版)中为我工作,但在SugarCRM 7的情况下,当我提到查询参数时,它不起作用。如果我提及'查询' =>''然后我从sugarcrm 7服务器获取所有记录。当我为查询参数指定任何过滤器时,它会失败。我正在使用RestAPI - 4.1 $ get_entry_list_parameters = array(
//会话ID
'session' => $session_id,
//The name of the module from which to retrieve records
'module_name' => 'Accounts',
//The SQL WHERE clause without the word "where".
//'query' => "Accounts.billing_address_postalcode='60329'",
// 'query' => "Accounts.name='Ingrid Rofalsky'",
'query'=>'',
//The SQL ORDER BY clause without the phrase "order by".
'order_by' => "",
//The record offset from which to start.
'offset' => 0,
//A list of fields to include in the results.
'select_fields' => array(
'id',
'name',
),
//A list of link names and the fields to be returned for each link name.
'link_name_to_fields_array' => array(),
//The maximum number of results to return.
'max_results' => 10,
//If deleted records should be included in results.
'deleted' => 0,
//If only records marked as favorites should be returned.
'favorites' => false,
);
print_r($get_entry_list_parameters);
$get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url);
echo '<pre>';
print_r($get_entry_list_result);
echo '</pre>';
有人可以帮我这个..
谢谢。 问候 - Bhagya
答案 0 :(得分:0)
Rest API在Sugar7中发生了很大的变化。
调用的URL应该是
http://servname.com/pro720/rest/v10/Accounts?filter[0][name][ $开始] = B和过滤[0] [email_addresses.email_address] =burgers@example.com&字段=名,ACCOUNT_TYPE,描述,电子邮件
如果您使用以B开头的名称过滤帐户,则邮件地址为burgers@example.com,并且您只检索字段名称,帐户类型,说明和电子邮件
答案 1 :(得分:0)
在查询选项中将模块名称更改为小写可解决此问题。
再次感谢
此致 - Bhagya