Reference 'Enum Field' in application object 'Test Enum Table' does not exist
Describe the bug A very simple use case: You create a new table that has an enum field and additionally a FlowField that accesses this enum field. When compiling, the following error appear:
"Reference 'Enum Field' in application object 'Test Enum Table' does not exist"
To Reproduce Steps and/or AL code to reproduce the behavior:
enum 50000 "Test Enum"
{
Extensible = true;
value(0; Test)
{
}
value(1; "Test 2")
{
}
}
table 50000 "Test Enum Table"
{
DataClassification = CustomerContent;
fields
{
field(1; "Primary Key"; Integer)
{
DataClassification = CustomerContent;
}
field(2; "Enum Field"; Enum "Test Enum")
{
}
field(3; "Test Flow Field"; Integer)
{
BlankZero = true;
FieldClass = FlowField;
CalcFormula = Count ("Test Enum Table" WHERE ("Enum Field" = CONST (Test)));
}
}
keys
{
key(PK; "Primary Key")
{
Clustered = true;
}
}
}
Expected behavior The usage must work in the same way as it used to work with option fields.
Versions:
- AL Langauge: 2.0.58805
- Business Central: 13.0.25924
This has been fixed in the latest preview and it will be available in the next CUs.
Hi @atoader. I installed new CU4 of BC on-premises but this fix isn't there.
Versions:
- AL Language: 2.1.79379
- Business Central: 13.0.27183
Hi @atoader. I installed new CU4 of BC on-premises but this fix isn't there.
Versions:
- AL Language: 2.1.79379
- Business Central: 13.0.27183
Hi @FSharpCSharp ,
I'm using same version as @dejfidson mentioned and is working fine, only thing I changed in your code is filtered the index of enum field. "CalcFormula = Count ("Test Enum Table" WHERE ("Enum Field" = filter (0)));"
Hi @atoader. I installed new CU4 of BC on-premises but this fix isn't there. Versions:
- AL Language: 2.1.79379
- Business Central: 13.0.27183
Hi @FSharpCSharp ,
I'm using same version as @dejfidson mentioned and is working fine, only thing I changed in your code is filtered the index of enum field. "CalcFormula = Count ("Test Enum Table" WHERE ("Enum Field" = filter (0)));"
it's a workaround, but certinly a bad practice, let's see when this is fixed and we should be able to use Const and Filter with something like "Enum Object"::[Option]
@babak2000ir fixes are implemented only in the master branch which corresponds to the next major release. You can access Docker images from this branch through the Collaborate program.
Hi @atoader - has this been fixed in last version of BC ?