SugarCRM通过不工作来休息API顺序


SugarCRM rest API order by not working

我尝试对get_entry_list rest api方法返回的记录进行排序,但它不起作用。

请求 JSON:

{
   "session":"mj95dgk1ldtd2m96u02oj0u3r2",
   "module_name":"Accounts",
   "query":"accounts.name LIKE 'Air%'",
   "order_by":"accounts.name desc",
   "offset":0,
   "select_fields":[
   ],
   "link_name_to_fields_array":"",
   "max_result":100,
   "deleted":0,
   "favorites":false
}

我使用的是 api 版本 4.1。

即使使用ASCDESC排序方法也不会对结果进行排序。

设法根据

此链接解决问题https://web.sugarcrm.com/support/issues/806c9fb3-6712-abd6-3106-5287d5398699

建议的修复:in service/v4/SugarWebServiceUtilv4.php在第 89 行周围:删除或注释以下行:$order_by=$seed->process_order_by($order_by, null);

SugarBean中修复这个问题当然会更好.php(process_order_by),其中删除了以下测试:if (strchr($value,'.') === false)

似乎是糖CRM中的错误(错误:59526)。

通过不使用 Web 服务进行排序

但是您也可以通过为Api创建自己的方法来获取记录,希望这有所帮助!