我想知道在通过Web服务API从Acumatica检索数据时是否有办法添加“Order By”子句?
ask._tags.pull(tagId)
我想通过DefaultPrice对结果进行排序,以便我可以检索列表中最昂贵的200个项目(在这种情况下使用iMaxRecords = 200)
我还没有看到任何允许我进行排序的参数。
答案 0 :(得分:0)
当我开发循环分配系统并且简短的答案是使用Acumatica API时,我遇到了这个问题,你不能对你在API之外做的结果做一个排序(这个信息来自一个朋友紧密联系在一起到Acumatica产品)。
我想出了两个选择:
您可以使用一些Linq并构建第二个按价格排序的数组[] [],然后将其修剪为前200个(您需要首先获得Acumatica的所有结果)。
// This is rough but should get you there.
string[][] MaxPriceList = sReturn.OrderBy(innerArray =>
{
if () // This is a test to make sure the element is not null
{
decimal price;
if (//test decimal is not null))
return price;
}
return price.MaxValue;
}).Take(200).ToArray(); //Take 200 is a shot but might work