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;
}
}
}
}