All Around Microsoft Dynamics Business Central

Filter length for SETFILTER in Microsoft Dynamics NAV 2017 and the 2100 parameters issue

In previous versions of Microsoft Dynamics NAV, the filter length is limited to 1024 characters.

With Microsft Dynamics NAV 2017 the filter length is „unlimited“. But you have to be carefull. The Microsoft SQL Server allows per default only 2100 parameters in a SQL statement.

The following Standard NAV code will throw the exception

„Too many parameters were provided in this RPC request. The maximum is 2100.“

if you have more than ~2100 Company No. in the „Contact Business Relation“ table and open the Office Addin for a mail without a sender adress:

setfilter

In this case the simplest workaround is to replace line 139 with „EXIT;„.