DimensionDynamicAccountController Class (Want to Create Lookup of Account Type and Account Num in New Table )

Hi all,

I have new table. In which I created two new fields

  1. Name → AccountNum, EDT–> DimensionDynamicAccount

  2. Name → AccountType, EDT–> LedgerJournalACType

Now I want look up same as in “LedgerJournalTransDaily” form. i.e When Accounttype == Ledger then Lookup from LedgerAccount

When Accounttype == Customer then Lookup from CustTable.

For This I have followed the step in Page 19 in white paper"Implementing_the_Account_and_Financial_Dimensions_Framework_AX2012" which is given below

Microsoft Dynamics AX form control

The Multi-Type Account control represents a combination of the Segmented Entry control and the DimensionDynamicAccountController class. The Segmented Entry control is a general-purpose control that has been introduced in Microsoft Dynamics AX 2012. The

DimensionDynamicAccountController

class handles the events raised by the Segmented Entry control. This combination allows the control to handle accounts of several different types.

Changes needed on the form

In simple scenarios, the changes needed on the form are as follows:

  1. Verify that the table that will hold the foreign key to the DimensionAttributeValueCombination table is a data source on the form.

  2. Drag the LedgerDimension field from the data source to the desired location on the form design. This action should add a Segmented Entry control at this location on the form with appropriate

DataSource and ReferenceField property values. Alternatively, you can complete this step by adding a Segmented Entry control to the design and manually setting the DataSource and ReferenceField

properties.

  1. Override the following methods on the form.

class declaration

:

public class FormRun extends ObjectRun

{

DimensionDynamicAccountController dimAccountController;

}

init (for the form):

public void init()

{

super();

dimAccountController = DimensionDynamicAccountController::construct(

ledgerJournalTrans_ds,

fieldstr(LedgerJournalTrans, LedgerDimension),

fieldstr(LedgerJournalTrans, AccountType));

}

  1. Override the following methods on the Segmented Entry control instance in the form design.

public void jumpRef()

{

dimAccountController.jumpRef();

}

public void loadAutoCompleteData(LoadAutoCompleteDataEventArgs _e)

{

super(_e);

dimAccountController.loadAutoCompleteData(_e);

}

public void segmentValueChanged(SegmentValueChangedEventArgs _e)

{

super(_e);

dimAccountController.segmentValueChanged(_e);

}

public void loadSegments()

{

super();

// (Optional parm*() specification should go here, see the Control options section.)

dimAccountController.parmControl(this);

dimAccountController.loadSegments();

}

public boolean validate()

{

boolean isValid;

isValid = super();

isValid = dimAccountController.validate() && isValid;

return isValid;

}

  1. Override the following methods on the data source field that backs the Segmented Entry control.

public Common resolveReference(FormReferenceControl _formReferenceControl)

{

return dimAccountController.resolveReference();

}

Now my problem is Lookup only works for AccountType==“Ledger” not for customer, Vendor etc.

it appears like

2313.Error.png

Please help me out in this

Hi Ishu

I have the same problem. Have you found any solution for this problem?

Thank you,

Esther Mulijono