Tip #54 | PowerShell Merge – A clustered key can appear only once in a table

If you upgrade your database to NAV2016 using the PowerShell Merge commandlets and have a change to table 49 you will run into this issue.

Table 49 is the Invoice Posting Buffer table that NAV uses to create G/L entries for each unique combination of values in the Sales and Purchase documents. With the NAV2016 release Microsoft have added the Deferral Code field to this table and the primary key.

One of the most popular mods to NAV is to add the description of the lines to this table to inherrit the description of the sales lines to the G/L Entries. This mod is also decribed in my book Microsoft Dynamics NAV 2013 Application Design.

The PowerShell merge tool does not understand that there is a conflict and will just add a second clustered index to the text file which results in this error:

Clustered1

To fix the issue, just remove one of the indexes in the text file and combine them into one.

Leave a Comment

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 )

Twitter picture

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.