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 :
Microsoft Dynamics AX (Archived)

Creating a ledgerJournalTrans record in an existing LedgerJournalTable (2012 R3 CU8) with a valid ledgerDimension

(0) ShareShare
ReportReport
Posted on by

I'm trying to import some data from an external database into a general journal.  I've got it working in general minus the fact that my ledgerDimension values are not coming up correctly.  

These are line items that will contain a date, an account type of ledger, and either a debit or credit.  So they are all main accounts.  To get the ledger dimension I simply call this for example:

ledgerTrans.parmLedgerDimension(DimensionStorage::getDefaultAccountForMainAccountNum('1234567')); 

where 1234567 is the main account.  When I launch the general journal form I am getting stack trace errors now because it's reaching back to a dimensionAttributeValueCombination that no longer exists.

How can I get this to construct the proper ledgerDimension recid on insert.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    You cannot use a Default account in a ledger journal.

    Take the value that you get back from DimensionStorage::getDefaultAccountForMainAccountNum() and pass it through DimensionDefaultingService::serverCreateLedgerDimensions() to arrive at a DAVC record ID that you can put on LedgerJournalTrans.

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Brandon is correct.

    I was just looking for the exact name of the same method. Then I noticed Brandon already answered.

  • Brandon Wiese Profile Picture
    17,788 on at

    I believe starting in R3 CU9 or CU10 you can pass a default dimension through one of the merge methods on the same class and it will translate implicitly also.  So, there are many ways to accomplish that specific task.

  • Community Member Profile Picture
    on at

    That worked perfectly.  Thank you so much

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans