Skip to main content

Notifications

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 74,036 Super User 2024 Season 2 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 32,748 Super User 2024 Season 1 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,091 Super User 2024 Season 1 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans