Sunday, February 1, 2015

Function DimensionValidation::validateByTree has been incorrectly called In Axapta 2012

Error : Function DimensionValidation::validateByTree has been incorrectly called.

Reason :
This error is coming because we are passing the account and offset account in wrong manner to LedgerJournalTrans . The field OffsetLedgerDimension and Ledger Dimension are of type :
DimensionDynamicAccount , so before passing the Account to these field , we need to convert the account to correct type .


 How to do it:
For non ledger account(Bank, customer ....) , we do have the API :
DimensionStorage::getDynamicAccount(A/cNo ,LedgerJournalACType::Bank);

we need to pass record as :

LedgerJournalTrans .LedgerDimension  = DimensionStorage::getDynamicAccount(Hedging_table.AccountID,LedgerJournalACType::Bank);


But what to do with Ledger Account , you still can not pass these account directly as well .

Well there is one more API which can help us :

LedgerJournalTrans .getLedgerDimensionForLedgerType(Ledger A/c,jourTrans.Company); 

we need to pass record as :

LedgerJournalTrans .LedgerDimension  =  
LedgerJournalTrans .getLedgerDimensionForLedgerType(Ledger A/c,jourTrans.Company);


@Rahul Talasila

No comments:

Post a Comment

Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?

  The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...