0

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 を使用しています

4

2 に答える 2

1

これを実行例として確認してください> http://urdhva-tech.blogspot.in/2013/02/rest-api-example.html

お役に立てば幸いです。

それ以外の場合、$ get_entry_list_parameters配列を見ると、正常に機能しているように見えます。

于 2013-02-18T08:35:42.603 に答える
1

service/v4/SugarWebServiceUtilv4.php の 78 行目から見てください。そこにブレークポイントを設定するか、生成されたクエリ ($where) をログに記録します。たぶん、これは理由を見つけるのに役立ちます。

于 2013-02-18T09:27:34.800 に答える