web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / AX Dev Help / Function DimensionValidatio...

Function DimensionValidation::validateByTree has been incorrectly called.

Gaurav Pandey Profile Picture Gaurav Pandey 960
While Creating General Journal using X++ , we faced this error:
Function DimensionValidation::validateByTree has been incorrectly called.

First let us go through , why we are getting this :

This error is coming because we are passing the account and offset account in wrong manner to LedgerJournalTrans . The field OffsetLedgerDimension and LedgerDimension are of type :
DimensionDynamicAccount , so before passigng 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 this AS :

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

There you go.......

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);
LedgerJournalTrans .LedgerDimension  = 
LedgerJournalTrans .getLedgerDimensionForLedgerType(Ledger A/c,jourTrans.Company);



Please put your comment ,if you find it helpful or looking for some more info......


Thanks,

This was originally posted here.

Comments

*This post is locked for comments