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

missing Shortcut Dimension 3 Code from table Gen. Journal Line

(1) ShareShare
ReportReport
Posted on by 173
Hi All,
How can I get Shortcut Dimension 3 Code in AL from table Gen. Journal Line. I can only see  Shortcut Dimension 1 and Shortcut Dimension 2  but on the page I can see them all
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    Hi, hope the following helps.
    How to add Shortcut Dimensions on the page in Dynamics 365 Business Central (Shortcut Dimension 3 ~ 8)
     
    PS: Dynamics 365 Business Central: How to add Dimensions to the page (Other than Global and Shortcut dimensions)
     
    Thanks.
    ZHU
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    But first try the following method
    Business Central 2023 wave 2 (BC23): Add existing table fields to optimize your pages (Adding Table Fields to Page without Page Extensions)
     
    Thanks.
    ZHU
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    My response was crafted with AI assistance, tailored to provide detailed and actionable guidance for your query.
    In Microsoft Dynamics 365 Business Central (and its AL development environment), the Gen. Journal Line table only explicitly stores values for Shortcut Dimension 1 and Shortcut Dimension 2. The other shortcut dimensions (e.g., Shortcut Dimension 3 Code to Shortcut Dimension 8 Code) are managed dynamically and linked to the dimension setup in the system.

    To access Shortcut Dimension 3 Code and other additional shortcut dimensions in AL, you need to use the GetDimensionSet or GetShortcutDimensionCode function from the Codeunit DimensionManagement

    1. Use the DimensionSetID field from the Gen. Journal Line table.
    2. Call the GetShortcutDimensionCode function from the DimensionManagement codeunit to retrieve the value of Shortcut Dimension 3 Code.

    Here’s an example code snippet:

    al 
    procedure GetShortcutDimension3Code(GenJnlLine: Record "Gen. Journal Line"): Code[20]
    var
    DimensionManagement: Codeunit "Dimension Management";
    ShortcutDimensionCode3: Code[20];
    begin
    // Retrieve Shortcut Dimension 3 Code
    ShortcutDimensionCode3 := DimensionManagement.GetShortcutDimensionCode(3, GenJnlLine."Dimension Set ID");
    exit(ShortcutDimensionCode3);
    end;

    Explanation:

    • The Gen. Journal Line table includes the Dimension Set ID field, which is a reference to the stored dimension combinations.
    • The DimensionManagement codeunit provides utility functions to retrieve individual dimension values using the dimension number (in this case, 3 for Shortcut Dimension 3 Code).

    Key Functions in DimensionManagement:

    • GetShortcutDimensionCode(DimensionNo: Integer; DimensionSetID: Integer): Code[20]
      • Retrieves the shortcut dimension value for the specified dimension number.

    Notes:

    • Ensure that Shortcut Dimensions are set up in the system (General Ledger Setup) and mapped to their respective dimension codes.
    • If you need to work with all dimensions at once, you can also retrieve them using the GetDimensions function in DimensionManagement codeunit.
  • Gerardo Rentería García Profile Picture
    25,390 Most Valuable Professional on at
  • KAYKAY Profile Picture
    173 on at
    Yun,
     
    Is there any other trigger that can be used instead of onaftergetrecord. I want it to be as automatic as onvalidate or onaftervalidate trigger.
     
    trigger OnAfterGetRecord()
        var
            DimMgt: Codeunit DimensionManagement;
            ShortcutDimensionCode: array[8] of Code[20];
        begin
            DimMgt.GetShortcutDimensions(Rec."Dimension Set ID", ShortcutDimensionCode);
            Rec."Shortcut Dimension 3 Code" := ShortcutDimensionCode[3];
            Rec."Shortcut Dimension 4 Code" := ShortcutDimensionCode[4];
            Rec."Shortcut Dimension 5 Code" := ShortcutDimensionCode[5];
            Rec.modify
            /* ShortcutDimension6 := ShortcutDimensionCode[6];
            ShortcutDimension7 := ShortcutDimensionCode[7];
            ShortcutDimension8 := ShortcutDimensionCode[8]; */
        end;
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    Hi, Try OnAfterValidate Trigger of Account No. field.
     
    Thanks.
    ZHU

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 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans