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

Announcements

News and Announcements icon
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,494

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,494 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,732 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
    305,643 Super User 2026 Season 1 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,494 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
    305,643 Super User 2026 Season 1 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 681 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 598 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 579

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans