Expression this.CurrPage does not resolve in pageextensions
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:
- 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;
}
- 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'
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
From the code example, it seems there's a mismatch between pages and page extensions.