web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Modify field displayed value

(0) ShareShare
ReportReport
Posted on by 260

Greetings to all you.

I need to deal with the case below.

I have created a custom field on the item card as you can see below.

pastedimage1643024102779v1.png

Is there any way , to customize this field so that , the displayed value inside the field would be the value of the Column Name and not of the  Column No of the table? 

For example ,if i select the code 6 , atm , my custom field will display the value 6 , however i would like to display the value test instead on the item card.

Is it possible to do so? If yes, i would also need some help when it comes to the needed commands..

Thank you in advance for your time.

With respect,
Antonis

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

  • Verified answer
    YUN ZHU Profile Picture
    102,389 Super User 2026 Season 1 on at

    Hi, This is done in two main ways.

    1. Using TableRelation property: Add code and name fields, when code is filled in, the Name field is automatically written.

    tableextension 80111 MyExtension extends Item
    {
        fields
        {
            field(50101; MainCustomerNo; Code[20])
            {
                Caption = 'Main Customer No.';
                TableRelation = Customer."No.";
                DataClassification = CustomerContent;
    
                trigger OnValidate()
                var
                    Cust: Record Customer;
                begin
                    if Cust.Get(MainCustomerNo) then
                        MainCustomerName := Cust.Name;
                end;
            }
            field(50102; MainCustomerName; Text[100])
            {
                Caption = 'Main Customer No.';
                DataClassification = CustomerContent;
                Editable = false;
            }
        }
    }
    
    pageextension 80111 MyExtension extends "Item Card"
    {
        layout
        {
            addafter(Description)
            {
                field(MainCustomerNo; Rec.MainCustomerNo)
                {
                    ApplicationArea = All;
                }
                field(MainCustomerName; Rec.MainCustomerName)
                {
                    ApplicationArea = All;
                }
            }
        }
    }

    pastedimage1643071282118v1.png

    2. Using Onlookup trigger

    tableextension 80111 MyExtension extends Item
    {
        fields
        {
            field(50102; MainCustomerName; Text[100])
            {
                Caption = 'Main Customer No.';
                DataClassification = CustomerContent;
    
                trigger OnLookup()
                var
                    Cust: Record Customer;
                begin
                    Cust.Reset();
                    if Page.RunModal(Page::"Customer List", Cust) = Action::LookupOK then
                        MainCustomerName := Cust.Name;
                end;
            }
        }
    }
    
    pageextension 80111 MyExtension extends "Item Card"
    {
        layout
        {
            addafter(Description)
            {
                field(MainCustomerName; Rec.MainCustomerName)
                {
                    ApplicationArea = All;
                }
            }
        }
    }

    pastedimage1643071564877v2.png

    pastedimage1643071575072v3.png

    pastedimage1643071590078v4.png

    Hope this will help.

    Thanks.

    ZHU

  • AntonisK Profile Picture
    260 on at

    yzhums

    Thank you so much sir.

    It worked just as i wanted to do so.

    Appreciated!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 653 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 414 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 394 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans