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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Shortcut dimension AL ?

(0) ShareShare
ReportReport
Posted on by 795

Hello Expert,

I am trying to assign shortcut dimension 4 value to purchase journal line through code but I am unable to do it. I am directly inserting the value in Dimension set entry table then inserting the dimension set iD to purchase journal line for reference but it's not working.

I have the same question (0)
  • Suggested answer
    Chameera Kavinda Profile Picture
    510 on at

    Hi,

    You can use the ValidateShortcutDimCode function.

    For exmple if you want to insert “ABC“ as shortcut dimension 4, you can use it like below.

           RecGenjnlLine.ValidateShortcutDimCode(4,'ABC');

    Thanks.

  • Muhammad Arif Maseed Profile Picture
    795 on at

    Thanks for the response,

    I have tried but through this way, it is not assigning the shorCutDim 4

     TempGenJournalLine.SETFILTER("Journal Template Name", 'KØB');

     TempGenJournalLine.SETFILTER("Journal Batch Name", 'STANDARD');

     TempGenJournalLine.SETFILTER("Line No.",FORMAT(14000));

     IF TempGenJournalLine.FINDSET THEN BEGIN

       DIMvAL:= 'DIMVAL';

       TempGenJournalLine.ValidateShortcutDimCode(4,  DIMvAL);

       TempGenJournalLine.MODIFY;

       END;

  • Suggested answer
    Chameera Kavinda Profile Picture
    510 on at

    Hi,

    Can you try below code.

    TempGenJournalLine.SETFILTER("Journal Template Name",'%1', 'KØB');

     TempGenJournalLine.SETFILTER("Journal Batch Name",'%1' ,'STANDARD');

     TempGenJournalLine.SETFILTER("Line No.",'%1' ,14000);

     IF TempGenJournalLine.FINDFIRST THEN BEGIN

       DIMvAL:= 'DIMVAL';

       TempGenJournalLine.ValidateShortcutDimCode(4,  DIMvAL);

       TempGenJournalLine.MODIFY;

       END ELSE BEGIN

            ERROR('Line cannot be found');

       END;

    Thanks

  • Muhammad Arif Maseed Profile Picture
    795 on at

    Thanks again for response ,  I have tried with the above code buts still no luck No error,

  • Muhammad Arif Maseed Profile Picture
    795 on at

    Dimension set entry is also null

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,496 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 961 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 870 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans