Sunday, 1 February 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

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...