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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Display Vendor Name when I choose the vendor ID

(0) ShareShare
ReportReport
Posted on by 35

Hi everyone,

I need to fill the Name field when I select a vendor ID

How I can do it

pastedimage1681399239996v2.png

thanks

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at

    You can make the Name field as flowfield to show the name based on the Vendor No.

    Or you can write code in OnValidate trigger of Vendor No. field to get the vendor record and assign Name

  • Verified answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    Hi company1,

    You have two options to achieve this. You can either add your logic to the OnValidate() trigger of VendorID field on the page level, or you can create a method in your table which gets the vendor name using the vendor ID, here is the code for the method

        procedure displayVendorName(): Text
        var
            vendTable: Record Vendor;
        begin
            if vendTable.Get(Rec.VendorID) then begin
                exit(vendTable.Name);
            end;
        end;

    Then, you use the displayVendorName() method in the page field as follows

                    field(VendorID; Rec.VendorID)
                    {
                        ApplicationArea = All;
                    }
                    field(PartcipantName; Rec.displayVendorName())
                    {
                        ApplicationArea = All;
                    }

    I hope this helps, let me know if you have any queries.

    Regards

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Is your page based on the standard vendor table or have you created your own table.

    If you have created your own table you can add a flow field to your table with the type LookUp.

    That will display the vendor name in the table even if it is not stored in your table.

    learn.microsoft.com/.../devenv-flowfields

  • Verified answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    Hi, I have mentioned several simple solutions in the following post, hoping to give you some hints.

    https://yzhums.com/22220/

    Thanks.

    ZHU

  • Verified answer
    Deekshitha Reddy Profile Picture
    219 on at

    I have used 2 tables here, So in the second table's card were I wanted to display name when id is entered. Write the code on trigger ONVALIDATE of id field. 

    field(1; studentid; Code[50])//Second Table 
            {
                DataClassification = ToBeClassified;
                trigger OnValidate()
                var
                    s1: Record Studenttable//variable of type record, from first table from where I am getting name(details) 
                begin
                    IF s1.Get(studentid) then
                        student_name := s1.studentname;
                end;
    field(2; student_name; Code[50])
            {
                DataClassification = ToBeClassified;
            }
    }
    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans