MSDyn365FO. Missing custom financial dimension.

If you want to make a table (standard or a new one) usable as a Financial dimension there is a step by step guide on docs Make backing tables consumable as financial dimensions – Finance & Operations | Dynamics 365 | Microsoft Docs

However, there is a gotcha, it won’t work if view’s name is too long (longer than 40 characters).

The issue lies with DimensionEnabledTypeCollection::getDimensionEnabledTypeCollection method, where it tries to select a record from SqlDictionary table by viewName

Under the hood it will generate a SQL statement like

(@P1 nvarchar(25))SELECT TOP 1 T1.RECID, T1.RECID FROM SQLDICTIONARY T1 WHERE( T1.NAME = @P1)

And @P1 parameter’s length would be different from time to time, causing truncation of the view’s name.  

There is a good yammer thread discussing this issue Yammer

So, the name is truncated, it cannot be found, and it throws an error:

The SQL view definition for %1 is deployed as a code package but has not been synchronized with the database. As it is currently used by one or more financial dimensions, the database must be synchronized to the code deployment.

However, you won’t see the error. To trigger it you need to do full DB sync or at least sync a view that uses this method, for example, FinancialDimensionValueEntityExistingListView. You won’t catch it during a build either because we all use Microsoft-hosted agents that do not do sync anymore. But what about a Tier-2 deployment? It does DB sync, however, it won’t fail either. It will be successfully deployed, and next error will be logged into the deployment logs:

Infolog diagnostic message: ‘The SQL view definition for MyView is deployed as a code package but has not been synchronized with the database. As it is currently used by one or more financial dimensions, the database must be synchronized to the code deployment.’ on category ‘Error’.

 But who would ever check the logs for a successful deployment?!

2 thoughts on “MSDyn365FO. Missing custom financial dimension.

  1. Tera September 28, 2022 / 9:04 pm

    There is another issue though, where you will see the error and that will extend cutover time – it is Upgrade AX12 -> D365. The sync will fail, you have to re-run upgrade step 10. For us, on the rerun, error didn’t repeat. Strange thing though that we don’t have custom dimension tables. Error we got is:

    ‘The SQL view definition for DimAttributeMainAccount is deployed as a code package but has not been synchronized with the database. As it is currently used by one or more financial dimensions, the database must be synchronized to the code deployment.’ on category ‘Error’.

    And we spent time finding the issue until retried the sync and error magically disappeared. There is something totally wrong with Sync engine.

    Mentioned method which uses select from SQLDictionary in article is no longer in D365 (10.0.28)

    and there is KB open: 699264

  2. Michal Zölfl September 29, 2022 / 3:10 pm

    Thanks for saving my time. Without you I would search the reason of “chain of command error” during upgrade to v10.0.29 many hours.
    I found out that 36 chars long view name is too much, it must be less.

Leave a comment