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

Notifications

Announcements

Community site session details

Community site session details

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

Automatic assign Dimension Code in Dimension Value.

(0) ShareShare
ReportReport
Posted on by 50

Hi, 

I have a problem with the code string, which will automatically assign a dimension code after creating an item. 

I have already written the code, which works, but I have a problem with filtering it so that it takes, for example, after the "item" dimension code.

I also have a problem with assigning the "Item Group" dimension code after the Item Category Code field. Any ideas?

Thanks for help.

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,748 Moderator on at

    Hi,

    Are you facing the problem in your code?

    Thanks.

  • Tony00001 Profile Picture
    50 on at

    Yes, when i'm using code, it's getting first Dimension Code in table, not that i want.

    So how i should filter it, to get specifiy Dimension Code?

  • Suggested answer
    Nitin Verma Profile Picture
    21,748 Moderator on at

    You have to filter on Dimension Value table to get the desired dimension code and put that into the Item card.

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    Also check out if Item Templates can do this already? It might do it, depending on what version you are on.

    Filtering in code is SETRANGE or SETFILTER, you can see some examples here:

    erpconsultors.com/.../

    hth

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,090 Moderator

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,090 Moderator

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,277 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans