Skip to main content

Notifications

Microsoft Dynamics NAV forum
Suggested answer

Automatically assign Product Group dimension

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;

Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,612 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,744 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,023 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans