Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression this.CurrPage does not resolve in pageextensions #7822

Open
christian-clausen opened this issue Aug 16, 2024 · 1 comment
Open

Comments

@christian-clausen
Copy link

christian-clausen commented Aug 16, 2024

1. Describe the bug

In pageextensions, this.CurrPage fails with a compilation error:

'Page MyPage' does not contain a definition for 'CurrPage'

This is rather strange, as CurrPage does resolve in both the page in the pageextension, so this.CurrPage should also resolve.

2. To Reproduce
Steps to reproduce the behavior:

  1. Write this code
page 50100 MyPage
{
    trigger OnOpenPage()
    begin
        this.SaveRecord();
        CurrPage.SaveRecord();
        this.CurrPage.SaveRecord();
    end;
 }

pageextension 50100 MyPageExtension extends MyPage
{
    trigger OnOpenPage()
    begin
        this.SaveRecord();
        CurrPage.SaveRecord();
        this.CurrPage.SaveRecord(); // 'Page MyPage' does not contain a definition for 'CurrPage'(AL0847)
    end;
}
  1. Observe the compilation error.

3. Expected behavior
I would expect this.CurrPage to resolve as CurrPage resolves.

4. Actual behavior
The code fails with compilation error error AL0847: 'Page MyPage' does not contain a definition for 'CurrPage'

image

5. Versions:

  • AL Language: Latest preview release - 14.0.1070882
  • Visual Studio Code: 1.92.1
  • Business Central: 25
  • List of Visual Studio Code extensions that you have installed:
    ms-dynamics-smb.al

Final Checklist

  • [x ] Search the issue repository to ensure you are reporting a new issue

  • [ x] Reproduce the issue after disabling all extensions except the AL Language extension

  • [ x] Simplify your code around the issue to better isolate the problem

@BazookaMusic
Copy link

From the code example, it seems there's a mismatch between pages and page extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants