Skip to content

Renaming enum value doesn't change initvalue of field using enum #8213

@BertDeTemmerman

Description

@BertDeTemmerman

Copy of #6441
Describe the bug
Renaming an enum value doesn't change the initvalue of field using enum

To Reproduce
Steps and to reproduce the behavior:

  1. create enum
  2. add value to enum (Calulation)
  3. create field in table of type enum of 1.
  4. set initvalue on the field
  5. rename enumvalue (Calculation, fixing the typo)
  6. Observe error AL0522 Property value "Calulation" is not in the values for enum 'Source Type'.

AL Code to reproduce the issue

enum 50000 "Source Type"
{
    Extensible = true;

    value(50000; "Calculation")
    {
        Caption = 'Calculation';
    }
        field(50000; "Source Type"; enum "Source Type")
        {
            DataClassification = CustomerContent;
            Caption = 'Source Type';
            InitValue = "Calulation";
        }

Retested it on newest version, as old bug got incorrectly closed ...
Image

Expected behavior
Initvalue also renamed.

Screenshots

5. Versions:

  • AL Language: (old 6.1.397164) -> 16.3.2065053
  • (old Business Central: BE Business Central 17.2 (platform 17.0.19353.20441 + toepassing 17.2.19367.20601))
    Version: BE Business Central 27.4 (Platform 27.0.46893.0 + Application 27.4.45366.47426)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions