2013-02-16 2 views
0

Sugar CRM에서 특정 리드를 업데이트하려고합니다. 이 ID의 ID를 모르므로 이메일 주소 나 이름을 사용하여 get_entry_list를 호출하여 리드 ID를 검색하려고합니다. 나는 시도조차get_entry_list API 호출의 query 매개 변수로 전자 메일을 제공하여 목록을 얻으려면 어떻게해야합니까?

'query' => "first_name = \"Bob\"", 

:

'query' => "first_name LIKE \"%Bob%\"", 

'query' => "email1 LIKE \"%[email protected]\"", 

하지만 난 그냥이 결과를 얻기를 그래서 같은 이메일 주소 나 이름을 쿼리를 사용하여 지정하고 싶었 :

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>'; 

편집는 : 나는 REST API를

을 v4_1 사용하고는

답변

1

실행중인 항목 확인>http://urdhva-tech.blogspot.in/2013/02/rest-api-example.html

희망이 있으시면 도움이 될 것입니다.

그렇지 않으면 $ get_entry_list_parameters 배열을 살펴보면 정상적으로 작동하는 것처럼 보입니다.

+1

이 davidboris에게 감사드립니다. 귀하의 예제에서했던 것처럼 쿼리에서 테이블 이름을 지정 했으므로 작동하는 것처럼 보였습니다! 'leads.email1 = \ "[email protected] \"'작품 !! –

1

service/v4/SugarWebServiceUtilv4.php에서 78 행부터 살펴보십시오. 거기에 중단 점을 설정하거나 생성 된 쿼리 ($ where)를 기록하십시오. 아마 이것은 당신이 그 이유를 찾는 데 도움이 될 것입니다.

관련 문제