1
我正在使用SugarCRM 6.5.14 SOAP API從模塊中檢索條目以填充表單。我的問題是該模塊中有209個條目,但SOAP只返回20個條目。SugarCRM get_entry_list只返回20個條目
我正在使用PHP和JS的AJAX查詢。
搜索後,我發現this answer,即使get_entries_count
返回正確的條目數,get_entry_list
仍然只返回20個條目。
這裏是我的PHP代碼:
$soapClient = new SoapClient("http://localhost/sugar/service/v3_1/soap.php?wsdl");
try{
$info = $soapClient->login(
array(
'user_name' => "webservice",
'password' => md5("MYPASSWORD"),
)
);
}catch(SoapFault $fault){
die("E_CONNECT");
}
$sessid = $info->id;
$max_count = $soapClient->get_entries_count($sessid, "comp_module", "", false);
$soapResponse = $soapClient->get_entry_list($sessid, "comp_module", "", "comp_module.name", array(), $max_count->result_count, false);
$response = Array();
$resellersArray = $soapResponse->entry_list;
foreach($resellersArray as $reseller){
array_push($response, array("id" => $module->id, "name" => $module->name_value_list[4]->value));
}
echo json_encode($response);
我不知道你在哪裏找到這個文檔,但是這對我有很大的幫助! – Jivay
@Jivay哈哈很高興我能幫忙。您可以在這裏找到許多開發者文檔:http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer,您可以通過訪問http:// localhost/service/v4_1/soap來查看特定api的API定義。 PHP在瀏覽器中。 –
另外請確保您沒有使用非常高的值。在C#中int.MaxValue(2147483647)只產生了20個項目,其中short.MaxValue(32767)產生了所有結果... –