Skip to main content

Notifications

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.

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Automatic assign Dimension Code in Dimension Value.

    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

  • Suggested answer
    Nitin Verma Profile Picture
    21,544 Moderator on at
    RE: Automatic assign Dimension Code in Dimension Value.

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

  • Tony00001 Profile Picture
    50 on at
    RE: Automatic assign Dimension Code in Dimension Value.

    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,544 Moderator on at
    RE: Automatic assign Dimension Code in Dimension Value.

    Hi,

    Are you facing the problem in your code?

    Thanks.

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,190 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans