Max. Page Size in OData Parameter

Posted on Posted in Microsoft Dynamics NAV

Target Audience: NAV Technical

Benefit: Remove congestion on the valuable server resources.

Parameter Max. Page Size in OData Tab is used to specify and control the maximum number of entities returned to get correct set of result. This service tier is also well-known as “Server – Driven Paging OData Web Services”.

Why Do We Need to Set the Max. Page Size in OData Parameter

This is important when Max. Page Size increases, it will create fewer chunks (or pages) per request which will reduce the processing time. Moreover, there will be an increase on Microsoft Dynamic NAV Server or Client memory consumption if the page size increases. This could results memory exceptions on Microsoft Dynamic NAV.

Therefore, it is very important to check and change the value of the Max. Page Size as well as set a good page size which will not cause any congestion on the valuable server resources. This will allows a great user experience (UX) on the user application side.

How to Configure Server-Driven Paging

Figure 1: Max. Page Size in OData Parameter

The default value of the Max. Page Size is 1000. To have a good page size, user should set the top number of rows by using OData queries. Besides that, to have a correct result set, the Max. Page Size value should be greater than the value which have been set by the TopNumberOfRows property and TOPNUMBEROFROWS function.

Figure 2: Set the TopNumberOfRows in Nav Query Object

How to Configure the Starting Page Size

The AddDataQueryFilter function is used to configure a Page Size for all query result entity. Here is an example on how to configure a Page Size with 4000 for all the query result entity.

config. AddODataQueryFilter (new EnableQueryAttribute {PageSize = 4000});

Summary

Two actions are needed to have a good page size and increase the performance of Microsoft Dynamics NAV Server are:

  • Set the value of the Max. Page Size as large as possible without overloading Microsoft Dynamics NAV Server.
  • When Microsoft Dynamics NAV Server result out memory exceptions then Max. Page Size should be reduced until the errors are terminated.

 

Leave a Reply

Your email address will not be published. Required fields are marked *