Closed NKarolak closed 9 months ago
This would be a good codecop rule, but not a compiler rule by itself. It stems from the fact that AL lacks generics and thus the page type does not encapsulate its expected record type. Unfortunately, this makes the example provided valid AL code.
There's quite a few methods that have this issue due to the same reason: eg. page.SetRecord()
I would suggest to report this in aka.ms/bcideas instead. We use the amount of votes as a way to prioritize ideas.
1. Describe the bug A compiler warning (and later error) is missing to prevent the following run-time error:
2. To Reproduce Declare the following code:
Run the procedure in the client. An error will occur.
3. Expected behavior Prior to publishing the code, the compiler should warn that the
SourceTable
of page "Sales Order" does not match the record variable passed inPage.Run
orPage.RunModal
. In later versions, the AL warning should be turned into an error.4. Actual behavior No warning or error on compiling.
5. Versions: