简体   繁体   English

Microsoft Dynamics Nav ReadMultiple按特定列对记录进行排序

[英]Microsoft Dynamics Nav ReadMultiple sorting records by specific column

I use ReadMultiple function to retrieve filtered data from Navision service as below. 我使用ReadMultiple函数从Navision服务检索过滤的数据,如下所示。

var customers = postedInvService.ReadMultiple(filtercustomers.ToArray(), CustomerParams.bookmarkKey, -10);

This works fine. 这很好。 But my requirement is to first sort from a specific column and get the records. 但是我的要求是首先从特定列进行排序并获取记录。 How to give the specific column in order to sort records? 如何给特定列排序记录?

There three different approaches to solve that problem. 有三种解决方法。

  1. With the SOAP Web Service and setSize = 0 you get the entire set of results. 使用SOAP Web服务setSize = 0您可以获得整个结果集。 You can sort the result with LINQ . 您可以使用LINQ对结果进行排序。 E. g. 例如

     var result = from serviceInvoice in postedInvService.ReadMultiple(filtercustomers.ToArray(), null, 0) orderby serviceInvoice.No select serviceInvoice; 
  2. In the Dynamics NAV Development Environment it is also possible to create a new Page have Fields and Sorting (Property SourceTableView ) how it is supposed to be. 在Dynamics NAV开发环境中,还可以创建一个新的页面,该页面具有字段和排序(属性SourceTableView ),应该是这样。

  3. Since Dynamics NAV 2013 Pages can also be fetchef from the OData Web Service which support server side sorting and filtering . 由于Dynamics NAV 2013页面也可以从OData Web服务获取 ,该页面支持服务器端排序筛选 Eg http://localhost:7048/DynamicsNAV90/OData/Company('CRONUS%20International%20Ltd.')/postedInvService?$orderby=PostingDate 例如http://localhost:7048/DynamicsNAV90/OData/Company('CRONUS%20International%20Ltd.')/postedInvService?$orderby=PostingDate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM