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 :
Small and medium business | Business Central, N...
Suggested Answer

Assigning dimension set ID when creating custom general journal entries

(8) ShareShare
ReportReport
Posted on by 142
Is there any out-of-box AL code function we can use to automatically assign the dimension set ID when creating custom general journal entries? I am trying to create custom intercompany general journal entries but having trouble assigning a dimension set ID to the custom entries. I would appreciate it if you can please share some code samples for assigning dimension set IDs for custom general journal entries just the way the system assigns dimension set IDs to system-created general journal entries.
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at
    To assign a Dimension Set ID to a custom general journal entry or any record like a Sales Order, you need to build a temporary set of dimension entries and then use DimMgt.GetDimensionSetID to generate the correct ID.
     
    var
        DimVal: Record "Dimension Value";
        TempDimSetEntry: Record "Dimension Set Entry" temporary;
        DimMgt: Codeunit "DimensionManagement";
        SalesHeader: Record "Sales Header";
    begin
        // Get the dimension value record
        DimVal.Get('SALESPERSON', 'SK');
    
        // Build a temporary dimension set entry
        TempDimSetEntry.Init();
        TempDimSetEntry.Validate("Dimension Code", DimVal."Dimension Code");
        TempDimSetEntry.Validate("Dimension Value Code", DimVal."Code");
        TempDimSetEntry."Dimension Value ID" := DimVal."Dimension Value ID";
        TempDimSetEntry.Insert();
    
        // Assign the Dimension Set ID to your record
        SalesHeader."Dimension Set ID" := DimMgt.GetDimensionSetID(TempDimSetEntry);
        SalesHeader.Insert();
    
     
     

    This is the same method Business Central uses internally, and it ensures proper dimension tracking and posting behavior.

     

    ✅ Mark this answer as verified if it helps you.

  • Suggested answer
    Mansi Soni Profile Picture
    8,907 Super User 2025 Season 2 on at
  • Gerardo Rentería García Profile Picture
    25,213 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Solved: GetDimensionSetID on ChangeCompany

    Business Central - purchase line - update shortcut/global dimensions — mibuso.com

    Best Regards
    Gerardo

  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,631 Super User 2025 Season 2 on at
  • Suggested answer
    RockwithNav Profile Picture
    8,600 Super User 2025 Season 2 on at
    This is assigned by default, what are you actually willing to achieve?
    Even if you have a custom process of general journal, which dimension set id you want to copy from?

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans