microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
722 stars 242 forks source link

Compiling App against Next Major shows AL0186 error #7650

Closed ralf-escher closed 5 months ago

ralf-escher commented 5 months ago

Since two nights our Next Major pipeline shows AL0186 errors.

For a few of our pages the compiler cannot find the fields from a Table Extension.

page/AutBlanketSalesOrder.Page.al(1120,35): error AL0186: Reference '"BET AUT Trans.-/Call Order No."' in application object 'Sales Header' does not exist
page/AutomotiveSalesOrder.Page.al(1936,63): error AL0186: Reference '"BET AUT Our Item No."' in application object 'Sales Header' does not exist
page/AutomotiveSalesOrder.Page.al(1948,35): error AL0186: Reference '"BET EDI Doc. No."' in application object 'Sales Header' does not exist
page/AutomotiveSalesOrderList.Page.al(645,35): error AL0186: Reference '"BET AUT Plant"' in application object 'Sales Header' does not exist
page/AutomotiveSalesOrderList.Page.al(657,63): error AL0186: Reference '"BET AUT Our Item No."' in application object 'Sales Header' does not exist

there was no change within these objects and there are plenty of other fields in these pages from the table extension which cause no error.

After the comment of @rdebath (see below) I can confirm that those fields above are used inside a Page Action within a RunPageLink

rdebath commented 5 months ago

To be specific there are plenty of other references to these fields that cause no error. I have to use both the .APP files and the VSIX extension from the pipeline (version 24.0.15544) to have these errors appear in VSCode. For previous v24, v23 and v22 the errors do not error.

For me all these references are in RunPageLink properties.

page 71952 "TVTWS Web Items"
{

    ApplicationArea = TVTBevica;
    Caption = 'Web Item List';
    PageType = List;
    SourceTable = Item;
    UsageCategory = Tasks;
    AdditionalSearchTerms = 'Bevica,Wine,TVision,Web,Integration,ECommerce,API';
    ContextSensitiveHelpPage = 'Web Item List';

    layout
    {
        area(content)
        {
            repeater(General)
            {    
...
                field("TVTWS Web Product Code"; Rec."TVTWS Web Product Code")
                {
                    ApplicationArea = TVTBevica;
                    ToolTip = 'Bevica';
                }

...

            }
        }
    }

    actions
    {
        area(processing)
        {

...

            action(WebProductList)
            {
                ApplicationArea = TVTBevica;
                Caption = 'Web Product';
                Image = Item;
                Promoted = true;
                PromotedCategory = Process;
                PromotedIsBig = true;
                PromotedOnly = true;
                RunObject = Page "TVTWS Web Product List";
                RunPageLink = "Code" = FIELD("TVTWS Web Product Code"); // AL0186
                ToolTip = 'Bevica';
            }
tableextension 71950 "TVTWS Item" extends Item
{
    fields
    {
        field(71950; "TVTWS Web Product Code"; Code[20])
        {
            Caption = 'Web Product Code';
            TableRelation = "TVTWS Web Product";

            ValidateTableRelation = false;
            DataClassification = CustomerContent;
        }

    }
}
NKarolak commented 5 months ago

I can confirm the very same like @rdebath described it for RunPageLink.

NKarolak commented 5 months ago

@BazookaMusic Can you please forward? There is some major issue in the latest AL Language build 13.*, it seems.

rdebath commented 5 months ago

I seem to also have the same issue with a LinkFields property on an XMLport

##[error]./C:/agents/Agent1/_work/612/s/App/Self/src/XMLport/HSBCNURGCTpain00100103.XmlPort.al(163,38): error AL0186: Reference '"TVT.HSBC Snder Bank Branch No."' in application object 'Payment Export Data' does not exist
    schema
    {
        tableelement("Gen. Journal Line"; "Gen. Journal Line")
        {
            XmlName = 'Document';
            UseTemporary = true;
            tableelement(companyinformation; "Company Information")
            {
...
                    tableelement(paymentexportdata; "Payment Export Data")
                    {
                        LinkFields = "TVT.HSBC Snder Bank Branch No." = FIELD("TVT.HSBC Snder Bank Branch No."), "SEPA Instruction Priority Text" = FIELD("SEPA Instruction Priority Text"), "Transfer Date" = FIELD("Transfer Date"), "SEPA Batch Booking" = FIELD("SEPA Batch Booking"), "SEPA Charge Bearer Text" = FIELD("SEPA Charge Bearer Text");
                        LinkTable = PaymentExportDataGroup;
                        XmlName = 'CdtTrfTxInf';
                        UseTemporary = true;
...
BazookaMusic commented 5 months ago

Thanks for bringing this up, we will fix it ASAP

TMEKUMA commented 5 months ago

I have the same with the SubPageLink.

JesperSchulz commented 5 months ago

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 24.0.15812.0 and VS Code Extension Version 13.0.934715.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/

rdebath commented 5 months ago

Huh, looks like we've only been getting 'core' versions since the 28th Jan. I can only see Version 24 localised versions for 27th Jan and before.

Oh, and your "Ready2Go" information is out of date (aka.ms/readytogo no longer exists). The sastoken provided by that program is no longer needed; you just have to add the -accept_insiderEula flag See here.

Also https://github.com/microsoft/navcontainerhelper/issues/3327 if that's a more appropriate spot.