AX – D365FO – How to solve error : The number of joins in the statement is 31. This exceeds the maximum of 26.

When modifying some base forms to include new tables you might get the error

The number of joins in the statement is 31. This exceeds the maximum of 26.  Turn on exception for this warning to see the call stack.

Image

In order to fix this we need to bump the max limit (default is 26.) We can do this by going to
System Administration > Setup > System > Server Configuration  Then go to the Performance Optimization tab and change the field ‘Maximum number of tables in join’ After making this change you may need to restart the aos in order for the changes to take affect.

This setting fixes the error but before making this change you should take a look at what you are trying to accomplish with this many joins. Can we get rid of some of the tables? Have we split the data into to many tables? Can this be accomplished another way? While having a form with this many joins can cause performance issues sometimes its your only option as default AX may already hit that 24-26 join mark so you are left with no option but to uptick the amount of joins allowed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s