Monday, December 19, 2011

AX 2012 - Add a new Financial Dimensions with the values linked to a Table


If you have to add a new Financial Dimensions with the values linked to a Table ( Setting an entity to be dimensionable  ) follow this steps :

To set an entity to be dimensionable, create a view as directed below. The entity will automatically appear as an available backing entity type.
Also, to integrate with the dimensions framework when deleting or renaming the natural key of the backing entity, you must write custom code on the backing table's delete method, and also on either the update or renamePrimaryKey method. See CustTable for an example of the pattern these methods must follow.

1. The view name must be DimAttribute[yourentityname]. For example, DimAttributeCustTable.
2. The view must contain a root data source named BackingEntity that points to your backing table to identify a surrogate key and natural key.
3. The view may optionally contain additional related data sources to handle inheritance or relational associations to provide additional fields, such as a name from the DirPartyTable.
4. The view must contain the following fields named exactly as follows:
• Key - Must point to the backing entity's SK field. For example, an int64 RecId field.
• Value - Must point to the backing entity's NK field. For example, a str30 AccountNum field.
• Name - Must point to the source of an additional description for the entity. For example, a str60 Description field.

Because the list of dimensionable entities are cached on both the client and server, the creation of a new dimensionable entity will not appear in the list of existing entities until a call to clear the caches is performed, or until both the client and the server are restarted. In order to clear the caches and have the new backing entity appear immediately, you must execute the following line of code within a job:

If a new Organization Model OMOperatingUnitType enumeration is added, the steps to make it dimensionable are similar but can be made shorter as follows: 31 IMPLEMENTING THE ACCOUNT AND FINANCIAL DIMENSIONS FRAMEWORK FOR MICROSOFT DYNAMICS AX 2012 APPLICATIONS

1. Copy one of the existing DimAttributeOM[entityname] views, rename it appropriately and adjust all associated labels and help text.
2. Expand the Datasource\BackingEntity (OMOperatingUnit)\Ranges node on the copied view and change the value property on the range to the new OMOperatingUnitType enumeration value that was just added.
Because the OMOperatingUnitType is backed by the OMOperatingUnit table, generic code already exists to handle the delete, update and renamePrimaryKey methods. Therefore, in this case, you do not need to update these methods.

Finally, due to activate the new Dimension read this blog

Enjoy !

1 comment:

Alex P. said...

Thanks a lot, Denis.
Your post is very helpful.