我正在使用 SugarCRM 6.5.14 SOAP API 从模块中检索条目以填充表单。我的问题是这个模块中有 209 个条目,但 SOAP 只返回 20 个条目。
我正在使用 PHP 和 JS 进行 AJAX 查询。
搜索后,我找到了这个答案,即使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);