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

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

  • Alberto Zamburlini Profile Picture
    39 on at
    RE: 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

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

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: 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

    Thank you very much

  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,594 on at
    RE: 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

    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;
    }

  • mjgmme1e Profile Picture
    5 on at
    RE: 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

    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
    Ethan-Sorenson Profile Picture
    225 on at
    RE: 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

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2025 Season 1

#2
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 339

#3
Mansi Soni Profile Picture

Mansi Soni 320

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans