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

Adding a field in a table

(0) ShareShare
ReportReport
Posted on by 700

Hi All,

In Business Central, I have to add a new field (column) named 'Currency' to 'Location' table. This new field (column) will contain the values fetched from table 'Currency'.

Now, I have created that new column but it is not displaying any data.

How to achieve this ?

Thanks !

Categories:
  • InsertX Profile Picture
    450 on at

    Using AL code a way to do is to make sure you set your tabelrelation.

    in your tableextension:

    field(80001; "Fieldname"; Code[20]){

       TableRelation = Location.Code;

       DataClassification = SystemMetadata;

    }

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    Did you do a TableRelation in your new Currency field to Currency table?

    TableRelation = Currency.Code;

  • Dynamics 365 Business Central Profile Picture
    700 on at

    currency.png

    Yes, I have added the TableRelation property too. But only '0' is being shown in each row of the 'Currency' column. Please refer the attached screenshot.

    Following is the AL code used :

    tableextension 50120 MyLocationExtension extends Location
    {
    fields
    {
    field(50121; Currency; Integer)
    {
    Caption = 'Currency';
    TableRelation = Currency.Code;

    }
    }

    var
    myInt: Integer;
    }
  • Verified answer
    Community Member Profile Picture
    on at

    Your table extension looks ok, but but try adding the field on the location card (5703) instead of the list. This way you can change the value when you go to edit the location.

    Tero

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