Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

Add Item Category Code Description to Item List Page

Posted on by 169

Dear colleagues

I would like to add Item Category Code Description as a column in the Item List Page, so that Sales People can search by the name of the Item Category

I had success in doing this kind of task recently with Zhu Yun's advice here

   

However, I could not use this method to add Item Category Code Description

Any help on how to do it?

Thank you,

Louise

  • Lovisa LH Profile Picture
    Lovisa LH 169 on at
    RE: Add Item Category Code Description to Item List Page

    Thank you Zhu for your helpful and thoughtful advice!

  • Lovisa LH Profile Picture
    Lovisa LH 169 on at
    RE: Add Item Category Code Description to Item List Page

    Thank you Inge for you continued helpful feedback!

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 70,124 Super User 2024 Season 2 on at
    RE: Add Item Category Code Description to Item List Page

    Hi, I don't see a problem with this, many setting data in the system use abbreviations, but please note that the length will be limited.

    For example,

    pastedimage1663802720884v1.png

    pastedimage1663802741598v2.png

    pastedimage1663802762058v3.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: Add Item Category Code Description to Item List Page

    Hi Lovisa LH

    To me it sounds like you chose a great approach based on your data.

    The Item Category field is a code field handling both alpha and numeric values so you should be all good with that approach.

    Just be aware that if you mix numeric values and numeric values in a code field you can get some odd sorting because the numbers will be sorted in alphabetical order and not in numerical order.

    And i do not think Microsoft will change the data type for that field so i do not see any problems here.

    Keep up to good work!

  • Suggested answer
    Lovisa LH Profile Picture
    Lovisa LH 169 on at
    RE: Add Item Category Code Description to Item List Page

    Dear Inge, Kit, Zhu and Amit

    Thank you for your suggestions.

    Since the categories were few, quite self explanatory and not long, (ie 01: Boxes, 02: Bottles), and 20 characters are allowed for Item Category Code, I decided to change the Item Category Code from numerical to alpha.

    So now the Item Cat Code is meaningful for the sales people and I did not need to add flowfields or page extensions, (although these are things that I want to learn how to do soon)

    If anyone with more experience sees an issue with this method down the road, please do say so!

    Thank you all once again

    Louise

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: Add Item Category Code Description to Item List Page

    Hi,

    Pls create one Purch. Inv. Line table and make it nature is flowfield and make connection with Item Category Table

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: Add Item Category Code Description to Item List Page
    [quote user="Ts. Kit Wong"]

    Hi, you may use Inge method to add Item Category Code Description.

    Or you may add a new flowfield on Item table to get the Item Category Code Description if you have developer license.

    [/quote]

    If you do it in AL you do not need a special dev license for that.

    The reason i often prefer not to use a flow field is that it can sometimes slow performance and increase the database space used. Especially in large tables that are often modified. 

    And here we always use the  primary key of the Item category table to find the description so the SQL operations for that will be very efficient and only be performed every  time you display the list and now for every modification you do to your item table.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 70,124 Super User 2024 Season 2 on at
    RE: Add Item Category Code Description to Item List Page

    Hi, I think the link below can give you some hints, and here I provide four simple solutions. (The practice of NAV is similar to the BC.)

    More details: https://yzhums.com/22220/

    1. 

    pastedimage1662698806555v1.png

    2. 

    pastedimage1662698817345v2.png

    3. 

    pastedimage1662698830781v3.png

    4. 

    pastedimage1662698840222v4.png

    Hope this helps.

    Thanks.

    ZHU

  • Ts. Kit Wong Profile Picture
    Ts. Kit Wong 60 on at
    RE: Add Item Category Code Description to Item List Page

    Hi, you may use Inge method to add Item Category Code Description.

    Or you may add a new flowfield on Item table to get the Item Category Code Description if you have developer license.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: Add Item Category Code Description to Item List Page

    The following page extension should fix that for you.

    pageextension 50103 ItemListExt extends "Item List"
    {
        layout
        {
    
            addlast(Control1)
            {
                field(ItemCategoryName; ItemCategoryName)
                {
                    Caption = ' Item Category Description';
                    ApplicationArea = all;
                }
    
    
            }
    
    
    
        }
    
        trigger OnAfterGetRecord()
        var
            ItemCategory: record "Item Category";
    
        begin
            If ItemCategory.Get(rec."Item Category Code") then ItemCategoryName := ItemCategory.Description else ItemCategoryName := '';
    
    
        end;
    
        var
            ItemCategoryName: Text;
    }

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,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans