2009-08-20 64 views
3

我有sugarcrm實例,想用自定義的php代碼從中獲取一些數據。Sugar CRM SOAP get_entry_list

我爲此使用nusoap客戶端。我能夠獲取數據,但只想選擇特定ID(記錄)的數據。我在做什麼是

$response = $client->call('get_entry_list',array('session'=>$session_id , 'module_name'=>'itf_Apartments', 'where'=>'itf_Apartments.id=2', 'order_by'=>'','offset'=>'','select_fields'=>array('name'))); 

但我沒有得到任何結果。是我的代碼有任何問題?

回答

0

你可以看看實例的sugarcrm.log文件,看看它裏面是否有SQL錯誤?我敢打賭,這個問題與'where'參數有關。

0

代碼是什麼需要使用和你一樣在SugarCRM的例子得到。

$proxy = new Soap客戶端( 'http://server.com/service/v2/soap.php?wsdl' ,array('exceptions' => 0));

$session = $proxy->login(array('user_name'=> $user , 'password' => md5($pass))); 


$query= " customer.id IN (select id from customer where customer.id = '" . $id . "' and deleted = 0)"; 

$result= $proxy->get_entry_list($session->id , 'customer', $query ,'', 0 ,array('email', 'username','password', 'name') ,null, 1000, -1) ;