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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Lookup Creation in Business Central

(0) ShareShare
ReportReport
Posted on by 700

Hi All,

I have to create some lookups on Employee Card in Business Central. I am unable to find any way to achieve the same, not getting a sample code too.

Could anyone please help in this direction.

Thanks !

Categories:
  • Avinash B Profile Picture
    1,455 on at

    Hi,

    Could you provide some more information?

  • Dynamics 365 Business Central Profile Picture
    700 on at

    For example, in Employee Card, a lookup field for Nationality needs to be created which will contain some 3-4 options.

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    In this case, you have to create a field and provide the table relation to the field.

    For Ex. Create a field called Nationality and in the Field properties, provide TableRelation = "Country/Region".

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Do I need to create a new table for Nationality, in which the options will be specified ?

  • Suggested answer
    Olister Rumao Profile Picture
    4,009 on at

    Hi,

    You already have Country/ Region field present in BC. You just need to add Country Regions and ZIP Codes for precise address.
    Refer screenshot below.

    EMPLOYEE.png

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    If you want to create just an Option field (Ex. Status in Employee, Gender in Employee), you have to create a field and specify the OptionMembers for the field.

    Like, create a field called Gender with type as Option and mention the OptionMembers = " ",Male,Female.

           field(50000;Gender;Option)

           {

               OptionMembers = " ",Male,Female;

           }

    OR

    If u want to create a field where the value flow from a different table (Ex. Country/Region Code in Employee - Value from Country/Region table), Create a field and provide the table relation.

           field(50000;Nationality;Code[20)

           {

               TableRelation = "Country/Region";

           }

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans