Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

missing Shortcut Dimension 3 Code from table Gen. Journal Line

Posted on by 37
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
  • gdrenteria Profile Picture
    gdrenteria 11,499 Most Valuable Professional on at
  • Suggested answer
    Saif Ali Sabri Profile Picture
    Saif Ali Sabri 218 on at
    missing Shortcut Dimension 3 Code from table Gen. Journal Line
    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.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,330 Super User 2024 Season 2 on at
    missing Shortcut Dimension 3 Code from table Gen. Journal Line
    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
    YUN ZHU Profile Picture
    YUN ZHU 72,330 Super User 2024 Season 2 on at
    missing Shortcut Dimension 3 Code from table Gen. Journal Line
    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

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,961 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,443 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans