LookUp issue for LedgerDimensionId based on Account type in AX2012

Hi all,

Hope you are doing well.

For our business need we copied the form InventJournalTable (InventoryAndWarehouseManagement\Journals\Item transactions\Movement) and customized the form…

We newly added two fields AccountType,DimensionDynamicAccount in InventJournalTable.

Now we are facing issue with lookup for the newly added field DimensionDynamicAccount when AccountType is ledger.

For the accounType of ledger lookUp for DimensionDynamicAccount field is empty. its populating lookup in DimensionDynamicAccount field properly except Ledger(AccountType).

i.e Account type DimensionDynamicAccount lookup

Customer customer accounts

Vendor vendor accounts

Ledger lookup is empty

Here is what i did–

  1. I dragged the edt DimensionDynamicAccount to the table InventJournalTable and i put the relation with the table DimensionAttributeValueCombination.

  2. In the form

a) class declaration: form
public class FormRun extends ObjectRun
{

LedgerDimensionDefaultAccountController offsetLedgerDimensionAccountController;
DimensionDynamicAccountController dimAccountController;//newly added
}
b) init (for the form):
public void init()
{
super();
dimAccountController = DimensionDynamicAccountController::construct(
InventJournalTable_ds,
fieldstr(InventJournalTable, DimensionDynamicAccount),
fieldstr(InventJournalTable, AccountType));
}

  1. Override the following methods on the Segmented Entry control instance in the form design.
    jumpRef, loadAutoCompleteData, segmentValueChanged, loadSegments, validate, lookup methods

public void lookup()

{

switch (InventJournalTable.AccountType)

{

case LedgerJournalACType::Cust:
CustTable::lookupCustomer(this,curext());
break;
case LedgerJournalACType::Vend:
VendTable::lookupVendor(this, curext());
break;
case LedgerJournalACType::bank:
BankAccountTable::lookupBankAccount(this, curext());
break;
case LedgerJournalACType::FixedAssets:
AssetTable::lookupAccountNum(this, curext());
break;
case LedgerJournalACType::Project:
ProjTable::lookupProjId(this, InventJournalTable);
break;
case LedgerJournalACType::RCash:
RCashTable::lookupAccountNum(this, curext());
break;
case LedgerJournalACType::Employee_RU:
EmployeeTable_RU::lookupAdvHolder(this, curext());
break;
default:
super();
}

}

  1. Override the resolveReference method on the data source field that backs the Segmented Entry control.

– Anyone please how to fix this issue…

Thanks,

Krishna.

please anybody guide me how to fix this issue…

Hi Krishna,

Please follow this link, may this help you,

http://axvuongbao.blogspot.in/2013/08/how-to-add-ledger-account-and-offset.html

But, when I am trying to control that OffsetAccount lookup filed based on Account Type, I am getting run time errors other than that everything is working fine.

Hope it will helps you.

Regards,

Ram

Hi Krishna,

I have done with this…

You have to write load segments method on form control level like this:-

public void loadSegments()

{

super();

dimAccountController.parmControl(this);

dimAccountController.loadSegments();

// Lock the main account segment if “Ledger” is selected in Account Type

if (MyTable.AccountType == LedgerJournalACType::Ledger)

{

dimAccountController.parmLockMainAccountSegment();

}

}

If any further clarification requires please revert back.

Regards,

Ram

Dear Ram,

the link which you suggested is related to single dimension…