Skip to main content
Business Central forum
Suggested answer

Automatic assign Dimension Code in Dimension Value.

editSubscribe (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.

  • 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
    Nitin Verma 20,984 Super User 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
    Tony00001 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
    Nitin Verma 20,984 Super User on at
    RE: Automatic assign Dimension Code in Dimension Value.

    Hi,

    Are you facing the problem in your code?

    Thanks.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,068 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,591 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans