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 :
Finance | Project Operations, Human Resources, ...
Answered

How to get whole ledgerdim for vendor

(0) ShareShare
ReportReport
Posted on by 172

Hi,

how Can I get the whole ledger dimension for vendor? Im trying to register a ledger invoice, when I pick the vendor from lookupon form the ledgerdimension and offsetaccount have multiple values.

But when I tryto add it with code I get only the Mainaccount. I use this helper class.

Also do I need to fill default dimensions here? If yes, how can I get it?

  ledgerJournalTrans.LedgerDimension        = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber('400008',LedgerJournalACType::Vend);

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    What's the AX version that you operate?

    Best regards,

    Ludwig

  • RadekM Profile Picture
    172 on at

    Im using AX D365FO

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    moved to the d365 forum

  • Verified answer
    RadekM Profile Picture
    172 on at

    Solution for this was to add this 2 lines.

                ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, LedgerDimension));
                ledgerJournalEngine.accountModified(LedgerJournalTrans);

    But now I have one more problem.

    I can't verify or post this invoice because used mainaccount isn't alloved to be used manually. Looks like there is some blocking validation on it. Is there a way to post it without changing parameters?

    Edit. FIxed

                ledgerJournalTrans.SkipBlockedForManualEntryCheck = true;

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

    Hi RadekM,

    Thanks for providing your own solution. I have marked your reply to get the status of your question to 'Answered'.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans