Saturday, October 31, 2015

Adding Financial Dimension Field in grid control AX 2012 R2

 

This blog is a direct guide on how to add Financial Dimension field in Grid control of form.  Adding Financial Dimension fields will help ax user to have an easy quick view in Financial dimension details in any of transactions instead of selecting other tabs. In this sample we will use Settle open transactions - customer (form)


.  Please refer to this link to view the form https://technet.microsoft.com/en-us/library/aa558602.aspx

Settle open transactions form before customization


 

Settle open transactions form after customization


 

List of procedures


1.       Create a query that will show Financial Dimension details. 

2.       Create a view based on the query created from no 1 procedure.

3.       Add relationship between the table and the view created from procedure 2.

4.       Add the view on the data sources of a selected form.

5.       Add Financial dimension field in the grid for the Settle open transactions - customer (form)


Procedure 1 : Create a query that will show Financial Dimension details. 



Data source needed


 

Steps
 
1. Open new AOT “Ctr + D” in you development work space, expand select Queries, right click then select New Queries.  
 
 
2. Rename the query to CustomDimensionList_Qry
 

 
 
 
3. Select the Data Source node of  CustomDimensionList_Qry  and right click select New Data Source. Then in the properties tab, set Table field = DimensionAttribute  and leave the name field as default = DimensionAttribute_1
 

 
 
4. Expand the DimensionAttribute_1 and on its data source, right click select New Data Source , Then in the properties tab, set Table field = DimensionAttributeValue and leave the name field as default = DimensionAttributeValue_1

 

 
 
5. Expand the DimensionAttributeValue_1and on its data source, right click select New Data Source , Then in the properties tab, set Table field = DimensionAttributeValueSetItem and leave the name field as default = DimensionAttributeValueSetItem_1


 
 
 

6. Expand the DimensionAttributeValueSetItem_1 and on its data source, right click select New Data Source , Then in the properties tab, set Table field = OMDepartmentView  and leave the name field as default = OMDepartmentView_1


 
 
 
7.  In this step we will choose which Financial dimension field we want to view in the grid. Financial Dimensions name can be found in  DimensionAttribute table.  On this example we’re going to select  Department Financial Dimension field.
 
To select the field, on Data Sources of CustomDimensionList_Qry select and expand DimensionAttribute_1, then goto node Range and right click New Range.


 
On the Range properties tab, set the following
 
Field = Name
Value = Department

 



Procedure 2 : Create a view using the query that is created from no 1 procedure.


Now let’s create a view based on the query that we created on the Procedure 1. For beginners on how to create a view based on query, please refer on the link below.



Data Source
CustomDimensionList_Qry
Fields
 
Name


Data Source
NameAlias
OMDepartmentView_1
Name
DimensionAttribute_1
DimensionAttribute
DimensionAttributeValue_1
DisplayValue
DimensionAttributeValueSetItem_1
DimensionAttributeValueSet
DimensionAttributeValueSetItem_1
Steps
1.       Press CRTL-D to open the AOT, expand the Data Dictionary node, right-click Views, and then click New View. A view is added to the list of views in the AOT.
Expand the new view, right-click the view, and then click Properties. The properties window opens and displays the view properties. Set the value of the following properties.
 
                           
PropertyValue
LabelCustomDimensionList
NameCustomDimensionList_vw

 



2 . Press CTRL-D to open a second AOT window, expand the Queries node, and scroll down find CustomDimensionList_Qry, then drag a query onto the Metadata node of the view. Notice how the Query property of the view is populated with the name of that query. The query provides the data source information for the view.




3.       Add Five fields, right-click Fields, and then click New View Field. Then set each fields properties using the details below
              
NameFieldData Source
NameAliasNameAliasOMDepartmentView_1
NameNameDimensionAttribute_1
DimensionAttributeDimensionAttributeDimensionAttributeValue_1
DisplayValueDisplayValueDimensionAttributeValueSetItem_1
DimensionAttributeValueSetDimensionAttributeValueSetDimensionAttributeValueSetItem_1
 
 
 
 
 
Procedure 3 : Add relationship between the table and the view created from.
 
On this procedure we will add relation to the primary table of Settle open transactions (Custtran), it also includes additional setup on the relation properties.
Warning: Wrong setup on the table relation properties might results to not view records in the grid.

Steps
 
1.  Press CRTL-D to open the AOT, expand the Data Dictionary/Table/CustTrans node.
 
 
 
  2.       Select Relations, Right-click and the click New Relation. On the Relation properties window set the value of the following properties.

 

3         Select the new Relation, then click New then select Normal. On the Relation field property window set the value of the following properties.

 
 
4.         Not let’s see the result, select the view, Right-click  then goto Add-Ins>Table browser.
                   On the results, you will notice that records was filtered by Name = “Department”, which is what set when we create the query.

 

 

Procedure 4 : Add the view on the data sources of a selected form (Settle open transactions - customer)
 
On this procedure we will add the CustomDimensionList_vw view on the Dara sources of Settle open transactions – customer.
Steps
 
1.  Press CRTL-D to open the AOT, expand the Form/CustOpenTrans node.

 


2.         Select Data Sources, Right-click and the click New DataSource. On the DataSource property window set the value of the following properties.



 
 
3. Then save and close AOT.
 
 
Procedure 5: Add Financial dimension field in the grid for the Settle open transactions - customer (form)
 
On this procedure we will add the Financial Dimension field in Settle open transactions – customer form

Steps
 
1.  Press CRTL-D to open the AOT, expand the Form/CustOpenTrans/Designs/Design/[Tab:Tabcontrol]/[TabPage:Overview]/[Grid:Grid]/ node.


2 . Select [Grid:Grid], Right-click and the click New Control then select StringEdit. On the Control property window set the value of the following properties.

Property
Value
Name
strDept
Skip
Yes
Label
Department
DataSource
CustomDimensionList
DataField 
NameAlias

 
 
 
There are other ways to add Financial dimension field. You can write a display method in X++ and set it to the Data Method property of which field you want to show the dimension value.
 
 
---- This posting is provided "AS IS" with no warranties, and confers no rights. ----

 
 
 
 
 






 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 

 

No comments:

Post a Comment