user1220497
user1220497

Reputation: 311

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?

Upvotes: 0

Views: 1377

Answers (1)

Daniel Göhler
Daniel Göhler

Reputation: 162

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. E.g. http://localhost:7048/DynamicsNAV90/OData/Company('CRONUS%20International%20Ltd.')/postedInvService?$orderby=PostingDate

Upvotes: 0

Related Questions