AL
AL copied to clipboard
this keyword does not work properly extension objects, table-, report-, page-
this.Calcfields(New_Field) run in a table extension does not find New_Field if it is declared in a table extension.
It seems that the this-keyword on a table extension refers to the base table, and does not consider extension fields (at least not in the same object). Thus we get conflicting requirements from the analyzer, where on the one hand we must use this, but on the other hand the field is not found if we use this.
AL[AA0248] tells me I must use the THIS keyword for the calcfields. However, if I add it:
AL0847 won't event let me compile.
We can use "Rec." though, but that's not what AA0248 says we should do, so maybe it's an issue with the analyzer..?
Same goes for page extensions. If we use a variable, we obviously cannot use Rec. "this" is recommended, but "this" fails:
error AL0847: 'Page Microsoft.Purchases.Document."Purchase Order"' does not contain a definition for
It does not work for report extensions either. We get a warning that we need to add this
Add 'this' qualification.AL[AA0248](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/analyzers/codecop-aa0248?wt.mc_id=d365bc_inproduct_alextension)
But if I add this
Report Microsoft.Sales.History."Standard Sales - Invoice"' does not contain a definition for 'FinanceChargeTerms_ASDF'
Will it ever be fixed?
Will it ever be fixed?
The "requires-triage" label tells you it was not even prioritized as one of the next fixes.