AL icon indicating copy to clipboard operation
AL copied to clipboard

Extension Table field cannot be used in a property (Editable/Visible) at a page

Open rickblommetjes opened this issue 6 years ago • 10 comments

Describe the bug When using a new field in an extension (by example Customer Table) in a page to set the properties Editable, we receive an error when loading/opening the page "Cannot find !

To Reproduce Steps and to reproduce the behavior: Set a boolean expression includsing the Field in the property, but only occurs after removing the Im/Explicit with statement warning in code by adding Rec.

AL Code to reproduce the issue

image

The problem is solved by moving the expression to a Boolean variable and by setting the variable in a local procedure

image

Expected behavior Either throw a compile error or warning but the code compiles normally but the page cannot be opened!!

Screenshots

5. Versions:

  • AL Language: v6.0.344420
  • Business Central:

image

rickblommetjes avatar Oct 02 '20 09:10 rickblommetjes

seems like basically a dupe of https://github.com/microsoft/AL/issues/6189 and hence https://github.com/microsoft/AL/issues/6095 and others.

dzzzb avatar Oct 02 '20 12:10 dzzzb

Yes, they are all duplicates. Looks like we forgot to backport an important fix. @esbenk @qutreson

kalberes avatar Oct 02 '20 17:10 kalberes

Great we see it coming:-)

rickblommetjes avatar Oct 06 '20 08:10 rickblommetjes

What is the server runtime version? 16?

esbenk avatar Oct 06 '20 11:10 esbenk

Just got the same error. Want to subscribe on bug status. Throws warning if you use any "Rec." in editable\visible property. Without Rec. works ok.

For example:

Page extension for Sales Order Subform. Any field property: Editable = (Rec.Type = Rec.type::Item);

Result on open page: The identifier 'Rec.Type' could not be found.

ABaludin avatar Oct 19 '20 14:10 ABaludin

Using Rec. in property expressions is not (and will not be) supported in server versions before 17.x. The compiler will issue warnings when runtime < 7.0.

esbenk avatar Oct 19 '20 18:10 esbenk

another dupe: #6048

dzzzb avatar Oct 20 '20 15:10 dzzzb

Using Rec. in property expressions is not (and will not be) supported in server versions before 17.x. The compiler will issue warnings when runtime < 7.0.

When are these warnings going to be implemented? People are still encountering duplicates of this: https://github.com/microsoft/AL/issues/6548

The compiler should definitely give compile errors if targeting a runtime in which this would otherwise be a deferred runtime error. There's no point letting something slip through to runtime that can't possibly work there. It just wastes everyone's time, ours and yours.

db-src avatar Mar 23 '21 09:03 db-src

Dear @Easystep2, we think this has been fixed. Please feel free to reopen if you can reproduce it again on our latest version.

nndobrev avatar Jul 29 '21 10:07 nndobrev

@nndobrev @kalberes I have this exact issue in a 27.2 Sandbox. Was this somehow reintroduced?

marcowintherJCD avatar Feb 05 '26 08:02 marcowintherJCD