Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

Posted on by Microsoft Employee

I am trying to create a new default dimension field on the Item Category Table, then link this to the Item Card when the Item Category is selected.  Can you assist me with how to manage this.

Thanks Glenda

*This post is locked for comments

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Carlos,

    I am hoping this is nothing to do with dimensions but basically two fields A and B on a table and the value of B depends on value of A,  for that you need to add the code on the validate of the field A to grab the value from B and populate.

  • Suggested answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Hi Carlos,

    in output journal, Generally there are two main things, Item or production order.

    but in any case, since this is the global dimension so it will be easy. you need to write a little code in the item journal line for OnValidate trigger of Field A.

    like, If I need to take the Global dimension of item from the item card to the output journal then it will be look like this on the Onvalidate trigger of Item No.

    IF "Entry Type" = "Entry Type"::Output THEN

      Validate(Shortcut Dimension 1 Code, Item.Shortcut Dimension 1 Code);

    Item is taken directly since item is global variable in item journal line table but if it is another table then you need to get it by user GET or filter criteria before applying to validate statement.

    This is just a sample but you can apply your code.

    Regards,

    Saurabh Shah

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Hi Saurabh

    I seam to have a similar problem. Can you give me a bit more insight?

    My problem is as follows.

    I have a Table 1 with fields A and B (global dim 1).

    Now I need a solution where using value A in Output Journal automatically fills in related field B from Table 1. Seams like an easy problem but I am stuck.

    Would appreciate it a lot if you could give me some hints.

    Thanks Carlos  

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Thanks for the advise, I went with changing the Global Dimension 2 Code as it was not used in the companies system and everything flows perfectly.

  • Verified answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Hi Glenda,

    I just want to know whether you want to copy the Global dimensions (shortcut dimension 1 & 2) or others.

    If it is for Global dimensions then it will be easy,

    You need to add one field on item category list for the dimension value and when you select the item category you can write a little code (already there is a code for posting groups and you can follow the same) to copy this dimension value to shortcut dimension 1 or 2.

    If it is other dimensions then you need to do write some more code but with the same pattern.

    We have done this earlier for our client and it works.

    Regards,

    Saurabh Shah

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Create Default Dimension Field on Item Category table and Automatically insert into the Item Card default Dimension

    Hi,

    You may add the respective entries in the Default Dimension table and while creating the Items , you write a code to copy them over to Default Dimension table with the table ID as 27 with VALIDATE and I think, the rest will be done by the code in the Default Dimension table.

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans