How to create a custom table to use as a Ledger Financial Dimension - Dynamics 365 for Finance and Operations
One of our Dynamics 365 client need to have new custom data entity/form and then want to enable it for use as a Ledger Financial dimension. The financial dimensions framework of Dynamics 365 For Finance and Operations allows you to configure as many financial dimensions as you require using values from various out of the box entities such as Cust, vend, employees, items etc. However, there are some cases where you need to customize Dynamics 365 for Finance and Operations and add new custom data entities/tables to address specific needs of your business. In those cases, you may want to use these custom entities as one of the financial dimension, to be able to do appropriate financial reporting. This post will give you a walk-through about how to enable a table to use as a Ledger Financial Dimension.
Below are the list of AOT objects that are required to create a new custom financial dimension in D365 For Operations. I have mentioned the steps no through will we will proceed.
I am running with requirements of two tables but for reference i will go with one table
1 - Table: FG_BusinessUnitSAC
I have created a simple table with Code and Description fields.
2- Form:
Created a simple list form for client's data entry
3- Menu item:
Created a display type menu item
4- Menu Extension:
Created a menu extension of General ledger and placed the newly created menu item under this menu.
5- View:
Created a view for exposing my customized table to Financial dimension drop down. While creating view we have to take care of following points.
- Label of view must be identified
- Singular label of view must be identified
- Datasource name must be named as BackingEntity
- There should be three fields.
1- Key = FG_BusinessUnitSAC.Recid
2- Value = FG_BusinessUnitSAC.Code
3- Name = FG_BusinessUnitSAC.Description
- There should be two unique indexes as mentioned below in image.
- There should be a method with following code
public class FG_DimAttributeBU extends common { /// <summary> /// register a view identifier as a dimension enabled type identifier /// </summary> [SubscribesTo(classStr(DimensionEnabledType),delegateStr(DimensionEnabledType,RegisterDimensionEnabledTypeIdentifiersDelegate))] public static void registerDimensionEnabledTypeIdentifier(DimensionIEnabledType _dimensionEnabledType) { _dimensionEnabledType.registerViewIdentifier(tablestr(FG_DimAttributeBU)); } }
6- Runnable Class.
Because the list of entities that can be consumed as a dimension are cached on the server, the creation of a new 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. To clear the caches and have the new view appear immediately, you must execute the following line of code within a runnable class.
class ClearingDimensionCache { /// <summary> /// Runs the class with the specified arguments. /// </summary> /// <param name = "_args">The specified arguments.</param> public static void main(Args _args) { DimensionCache::clearAllScopes(); } }
After following above steps go through the following navigation.
General ledger -> Chart of Accounts -> Dimensions -> Financial Dimensions
After going through following navigation click on use values from drop down you will get the newly created views.
*This post is locked for comments