function dimensionvalidation:: syncstructurechangesprivate has been incorrectly called

You might encounter the message “function dimensionvalidation::syncstructurechangesprivate has been incorrectly called” when dealing with importing ledger journal lines.

The error relates to a ledger dimension or offset ledger dimension being incorrectly formatted, normally as a result of data importing, or X++ code used to build a journal.

If you are trying to load non ledger accounts into the journal, customers, vendors or bank, you can use the following X++ command:

ledgerJournalTrans.LedgerDimension = DimensionStorage::getDynamicAccount(VendAccount, LedgerJournalACType::Vend);

Changing the LedgerJournalACType for the appropriate account type.

If you want to use the standard summary offset account for the customer or vendor then you can use the following command to load the value:

ledgerJournalTrans.OffsetLedgerDimension = LedgerJournalTrans.getLedgerDimensionForLedgerType(DimensionStorage::getLedgerDefaultAccountFromLedgerDim(VendTable.summaryLedgerDimension()), LedgerJournalTrans.Company);

The above is an extension of the follow which will let you populate the ledger account to use with any ledger account value. This can then be passed into either the ledgerDimension field or OffsetLedgerDmension field.

LedgerJournalTrans .getLedgerDimensionForLedgerType(Ledger Account, LedgerJournalTrans .Company);

Handling ledger accounts can be a challenge in AX2012, so I hope this helps.

Advertisements

One thought on “function dimensionvalidation:: syncstructurechangesprivate has been incorrectly called

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s