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, ...
Suggested Answer

How to combine main account id with financial dimensions, x++

(0) ShareShare
ReportReport
Posted on by 6,478

Hello,

we are creating General journals by code based on custInvoiceTrans table.

We have a new specific parameter for MainAccountId.

We want 'LedgerJournalTrans.LedgerDimension' field to be filled with "MainAccountId + Financial dimensions" from custInvoiceTrans.

What classes to use to achieve it?

Could anyone share some examples?

Thanks.

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

    Hello Johnny,

    Can you try making use of fixed financial dimensions that you can setup in the main account table?

    This fixed financial dimension setup will overwrite and fill the findims automatically at the time you post.

    Maybe that might be an option to avoid any code adjustment.

    Best regards,

    Ludwig

  • Johnny Profile Picture
    6,478 on at

    Hi Ludwig,

    Could you please give more details? I can't see any "Fixed Financial Dimensions" on Main Account form. Maybe I'm looking in a wrong place..

  • Suggested answer
    SouravDam Profile Picture
    11,730 on at

    Hi Johnny Almeida,

    This is what Ludwig has explained.

    You need to set fixed financial dimension in Main accounts form in below path.

    General ledger > Chart of accounts > Accounts > Main accounts.

    Select the account and then click on "Default dimensions" in the 'Legal entity overrides' section. You will get one more window where you can specify the dimension value and set this as Fixed value selecting from the drop down.

    Then click OK to complete this setup.

    pastedimage1629376930655v1.png

    Regards,
    Sourav

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

    Hi Johnny,

    The fixed financial dimension setup will not know the specific dimensions used per custInvoiceTrans record. There are various blog available on the internet where you can learn how to combine the main accounts and dimenions into a ledger dimension, e.g.:

    Manage Financial Dimensions in MSDyn365FO with X++ - Juan Antonio Tomás (jatomas.com)

    D365/AX7:Create Ledger Dimension From Main Account & Financial Dimension Values - All About Microsoft Dynamics (allaboutdynamic.com)

  • Johnny Profile Picture
    6,478 on at

    Hello Andre,

    I'm trying to use steps from this link:

    jatomas.com/.../

    Not quite sure which ones to use though.

    I have a defaultDimension from custInvoiceTrans (Fin. Dimensions from Sales Order).

    And I have a MainAccount ID from the Parameters (Let's say myParameters.MainAccountId).

    So, the goal is to have..

    LedgerJournalTrans.LedgerDimension = MainAccountId plus / combined with custInvoiceTrans.DefaultDImension.

    The methods described in the link you provided are to modify the existing DefaultDimension, not the ledgerDimension right? Or am I missing something?

    Thanks.

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

    Hi Johnny,

    These blogs are just one of the many blogs which are explaining how to use x++ code to manage the dimensions. I haven't checked the contents for all possible scenarios. You can use a search engine to find relevant blogs.

    In the standard application, your requirement is also quite often used. E.g. post the revenue of a sales invoice on an account setup on the inventory posting form and add the dimensions from the sales line. Possibly, you can also do some reverse engineering to get examples.

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 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans