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

Cannot add new field to existing page

(0) ShareShare
ReportReport
Posted on by 5

Hi all,

I am currently trying to add an extra field to the "Item" table - displaying that field on the "Item Card" page via an AL extension.  If I just add the field to the table the extension deploys to my sandbox successfully.  The code I'm using is virtually a direct copy from the documentation at: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-page-ext-object

When I attempt to deploy (Ctrl F5) the extension it gives me the error "error AL0118: The name 'MyField' does not exist in the current context." - which is referring to the "field" entry in the pageextension - i.e. It cannot find the field I created in my table extension.

If I change the "expression" portion of that statement to a literal value (e.g. 12345) then the field displays as expected (read only with the literal value in it).  What am I missing (seems like it shouldn't be this hard to get it to work).  I've even tried copying the "ShoeSize" code from the above link and it too doesn't exist.

Using latest AL extension in VSCode.  Cloud based BC (all up to date).

Not sure if there's a specific Dev forum I should be posting this in - please redirect me if there is.

Thanks,

Scott S.

tableextension 50100 ItemTableExtension extends Item
{
    fields
    {
        field(50101; MyField; Text[50])
        {
            Caption = 'My Field';
        }
    }

}

pageextension 50102 ItemCardExtension extends "Item Card"
{
    layout
    {
        // Add changes to page layout here
        addlast(Item)
        {
            field("My Field"; MyField)
            {
                ApplicationArea = All;
            }

        }
    }

}

I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    95,597 Super User 2025 Season 2 on at

    Hi, if your Sandbox is BC21, I think you just missed "Rec.".

    For example,

    pastedimage1674776682890v1.png

    More details: Business Central 2022 wave 2 (BC21) new features: Enable NoImplicitWith feature by default (New feature setting in app.json file)

    https://yzhums.com/29196/

    Hope this helps.

    Thanks.

    ZHU

  • ssouthurst Profile Picture
    5 on at

    That was exactly it!  Thanks!

    I did look at the "NoImplicitWith" page but didn't see anything that made me think it applied to my issue.

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,010

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans