Показать сообщение отдельно
Старый 28.08.2022, 07:46   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
ievgensaxblog: MSDyn365FO. Missing custom financial dimension.
Источник: https://ievgensaxblog.wordpress.com/...ial-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?!



Источник: https://ievgensaxblog.wordpress.com/...ial-dimension/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.