Sunday, December 8, 2013

Enhancement in Financial Dimension Lookup functionality

The below form shows all financial dimensions used in client’s company. I will show the functionality related to dimension Avdeling, which is a custom dimension.










After clicking the button Financial dimension values on the above form, the below form gets open:


















On the left side of the above form, all dimension values are being shown and on the right side all the properties of the selected dimension value are displayed. There is a field on right side “Select the level of dimension value to display” which contains 3 values: Shared Values, Chart of Accounts and Companies.
                In std AX 2012, if the field Suspended is ticked while Shared Values is selected in the above mentioned field then this dimension value will not be displayed in the look up of Avdeling dimension in segmented control as well as in dimension look up in customer/vendor master etc. form.             When the Companies option is selected then we can set properties/values for all companies separately as shown below:



















The client requirement was that if the Companies is selected in level field and the suspended check box is marked for some particular company then the selected dimension value should not be displayed in dimension lookup in that company.
So if the value 01 is suspended in company 001 then it should not be displayed in the lookup in company 001 and if it is not suspended in 002 then it should be displayed in 002.
Below form is General Journal lines form which is using segmented entry control to enter dimension values.




















Now I will show you the code which is used to show the dimensions in look up of segmented controls:

















In std AX 2012, there was only below code written in red area:
LedgerDimensionController::restrictQueryDimensionAttributeValues(_qbds, _dimensionAttributeId, false, false);
I created one more method LedgerDimensionController::restrictQueryDimensionAttributeValuesLed which will be called in case of dimensions (Not in case of Main Account selection).

Both methods have been shown below

























I added one more data source(DimensionAttrValueLedgerOverride) to the main data source and put the condition of not to show the suspended dimension here. The changes, I made in std method, have been shown below in red area:





















By using the above method, the dimension lookup in segmented control was showing only dimensions which were not suspended in that company.

                The client wanted the same logic of dimensions in normal dimension look up also e.g. in Journals/Customer/Vendor etc. forms as shown below:



I have shown the code below to be used in normal dimension lookup. The below changes are done in init method of DimensionDefaultLookup form. My changes are shown in red area.







4 comments:

  1. HI,
    The code is not visible. Can you type the code please.

    ReplyDelete
  2. Hi Pawan

    Could you please show the code for the DimensionDefaultLookup ?

    BR
    Jan

    ReplyDelete
  3. Hi Pawan,
    I have similar scenario on default dimension value filter.
    The code is not visible. Can you please share the code or xpo.
    Thanks.

    ReplyDelete
  4. Can someone share the code, its not clear.

    Thanks

    ReplyDelete