Skip to main content

Notifications

Announcements

No record found.

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;

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,981 Super User 2025 Season 1 on at
    RE: Automatically assign Product Group dimension

    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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 997 Moderator on at
    RE: Automatically assign Product Group dimension

    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
    Nitin Verma Profile Picture
    Nitin Verma 21,309 Moderator on at
    RE: Automatically assign Product Group dimension

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans