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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Automatically assign Product Group dimension

(0) ShareShare
ReportReport
Posted on by 25

Hi, I want to do function which will automatically assing Product Group dimension.

During Item Card creation, after assigning item card number, the system will automatically assign the Product Group dimension – it will be assigned after filling in the Item Category Code on item card. 

Can u help me with this? My code is below. 

My code: 

IF NOT DimensionValue.GET(Dimension.Code, "Item Category Code") THEN BEGIN
DimensionValue.INIT;
DimensionValue.VALIDATE("Dimension Code", Dimension.Code);
DimensionValue.VALIDATE(Code, Rec."Item Category Code");
DimensionValue.INSERT;
END;

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

    Hi,

    Please use Default Dimension table ID - 352, to insert default dimensions while creating new item. It will take below 4 fields values

    1. Table ID - 27

    2. No. - Your Item No.

    3. Dimension Code - your Dimension Code.

    4. Dimension Value Code - Your dimension value code.

    I hope it will help you.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    You can also use the UpdateDefaultDim methode in the DimensionManagement codeunit

    There are also several other methods in that codeunit to handle default dimensions.

    I think that is a better approach than programming an direct insert.

  • Suggested answer
    YUN ZHU Profile Picture
    98,421 Super User 2026 Season 1 on at

    Hi, I just recently tested an example of automatically assigning dimensions to customer cards, hopefully the code in the link below can give you some hints.

    (+) Automatic assign dimenions to customer card - Dynamics 365 Business Central Forum Community Forum

    Thanks.

    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

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 1,857 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans