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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

I created a custom API for Gen. Journal Lines and need to add Shortcut Dimension 3,4,5,6 Code but it is giving me error

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I'm very new in Business Central and just started it for my internship. I created a custom API for Gen. Journal lines as I couldn't populate all the fields I wanted in the default API. All fields are working but Shortcut Dimension 3 Code, Shortcut Dimension 4 Code, Shortcut Dimension 5 Code, Shortcut Dimension 6 Code. How can I manage to add this in the custom API to be able to populate them via Postman. 

Many Thanks,

Mario

I have the same question (0)
  • Suggested answer
    Ethan-Sorenson Profile Picture
    225 on at

    The easiest way to reconstruct a page to add your own logic is to look at the definition of the existing page. I can't really supply much more information without seeing the error you are encountering.

    I recommend using the AL Object Designer to look at the existing AL code in the system.

    3286.Dimension.png

  • mjgmme1e Profile Picture
    5 on at

    Ethan-Sorenson Thank you very much for your reply, my problem is not creating the shortcut dimension it is adding them in my custom API page, Dimension shortcut 1,2 code are added without a problem but when I want to add the other dimension shortcut codes (3-6) it tells me that "The name '"Shortcut Dimension 3 Code"' does not exist in the current context". I have created the dimension shortcut code 3-6 in general ledger setup in business central, but for some reason I can't add them in my custom API to then populate in Postman

  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,608 on at

    Shortcut Dimension 3 and above is not actual field on the table.

    You need to use variable and trigger to update the dimension set id .

    You can follow from General Journal Page on how to do that.

    Below is the sample code : 

    var
     ShortcutDimCode: array[8] of Code[20];
    
    field(ShortcutDimCode3; ShortcutDimCode[3])
    {
     ApplicationArea = All;
     CaptionClass = '1,2,3';
     TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3),
                                                   "Dimension Value Type" = CONST(Standard),
                                                   Blocked = CONST(false));
    
     trigger OnValidate()
     begin
      ValidateShortcutDimCode(3, ShortcutDimCode[3]);
     end;
    }

  • Suggested answer
    Community Member Profile Picture
    on at

    Thank you very much

  • Alberto Zamburlini Profile Picture
    39 on at

    i've the same identical problem have you found a solution?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,382 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,625 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,376

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans