web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 782

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
    RE: Shortcut dimension AL ?

    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
    782 on at
    RE: Shortcut dimension AL ?

    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
    RE: Shortcut dimension AL ?

    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
    782 on at
    RE: Shortcut dimension AL ?

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

  • Muhammad Arif Maseed Profile Picture
    782 on at
    RE: Shortcut dimension AL ?

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,285

#2
Sumit Singh Profile Picture

Sumit Singh 2,725

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,526

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans