Al: "#pragma implicitwith disable" causes problems with SubPageLink

Created on 16 Jul 2020  路  1Comment  路  Source: microsoft/AL

Describe the bug
As soon as the directive #pragma implicitwith disable is enabled on a page, SubPageLink properties are not working anymore if link of type field is used.

To Reproduce
Steps and to reproduce the behavior:

  1. Create a new project
  2. Add the code below and try to fix the errors
#pragma implicitwith disable
page 50000 "My Integer Page"
{
    PageType = List;
    UsageCategory = Lists;
    ApplicationArea = All;
    SourceTable = Integer;

    layout
    {
        area(Content)
        {
            field(Number; Rec.Number)
            {
                ApplicationArea = All;
            }
        }
        area(Factboxes)
        {
            part(MyFactbox; "My Factbox")
            {
                ApplicationArea = All;
                SubPageLink = "Number" = field(Number);
            }
        }
    }

}

page 50001 "My Factbox"
{
    SourceTable = Integer;
    PageType = CardPart;

    layout
    {
        area(Content)
        {

            field(Number; Rec.Number)
            {
                ApplicationArea = All;
            }
        }
    }
}
#pragma implicitwith restore

... If let the code as is, you get the following error about line SubPageLink = "Number" = field(Number);:

error AL0118: The name 'Number' does not exist in the current context

If you try to fix the SubPageLink that way:

SubPageLink = "Number" = field(Rec.Number);

you get this error:

error AL0104: Syntax error, ')' expected

Expected behavior
I do not know :) but we should have way to make it works.

Screenshots
./.

5. Versions:

  • AL Language: 6.0.302409
bug

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings