简体   繁体   中英

Microsoft Dynamics Nav ReadMultiple sorting records by specific column

I use ReadMultiple function to retrieve filtered data from Navision service as below.

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. You can sort the result with 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.

  3. Since Dynamics NAV 2013 Pages can also be fetchef from the OData Web Service which support server side sorting and filtering . Eg http://localhost:7048/DynamicsNAV90/OData/Company('CRONUS%20International%20Ltd.')/postedInvService?$orderby=PostingDate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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