2014-07-27 38 views
-1

我的代碼如下.. 請注意,我正在嘗試檢索其中Accounts.name ='bhagya'的所有帳戶。 相同的查詢在SugarCRM 6.5版(社區版)中適用於我,但在SugarCRM 7的情況下,當我提到查詢參數時它不起作用。如果我提到'query'=>'',那麼我會從sugarcrm 7服務器獲取所有記錄。當我爲查詢參數指定任何過濾器時,它會失敗。我使用RESTAPI - 4.1 $ get_entry_list_parameters =陣列(帶糖查詢參數的get_entry_list()方法crm 7不起作用

//會話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>'; 

有人能幫助我在這個..

謝謝。 Registers - Bhagya

+0

什麼錯誤(S)你的結果得到什麼?或者在你的SugarCRM日誌中? –

回答

0

其他API在Sugar7中有很大變化。

爲invokation的URL看起來應該像

http://servname.com/pro720/rest/v10/Accounts?filter[0][name][ $開始] = B &過濾器[0] [email_addresses.email_address] [email protected] &域=名稱,ACCOUNT_TYPE,說明,電子郵件

如果您正在使用與B開始的名稱過濾帳戶,郵件地址是[email protected]並在那裏你只檢索的字段名稱,ACCOUNT_TYPE,描述和電子郵件

+0

SugarCRM 7應該仍然完全支持傳統的RESTv4_1 API ......實際上所有的傳統API。使用新工具的最佳實踐,但如果您嘗試爲現有集成構建支持,則應該不會太困難。 http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.2/70_API/Web_Services/40_Legacy_REST/SOAP_APIs/ –