Skip to content

Evaluate extended value for enum gives error #7053

@RobertatK3

Description

@RobertatK3

1. Describe the bug
I have extended the Price Type Enum and get an error when trying to create a new price list:
image

The code that is giving the error is line 24 in codeunit 7018 "Price UX Management"
Evaluate(PriceSource."Price Type", PriceListHeader.GetFilter("Price Type"));

2. To Reproduce
I have created a simple app to show that evaluate does not except the value:
Create a enum extension for Price Type:

enumextension 50100 "K3A Price Type" extends "Price Type"
{
    value(50100; K3ARetail)
    {
        Caption = 'Retail';
    }
}

Create a page to test:

page 50100 "K3A Test Page"
{
    Caption = 'Test Page';
    PageType = Card;
    UsageCategory = Documents;
    ApplicationArea = All;
        
    layout
    {
        area(content)
        {
            group(General)
            {
                field(ChoosePriceType; PriceType)
                {
                    Caption = 'Price Type';
                    ApplicationArea = All;
                    ToolTip = 'Choose a price type to evaluate';

                    trigger OnValidate()
                    var
                        PriceListHeader: Record "Price List Header";
                        PriceSource: Record "Price Source";
                        PriceTypeFilterText: Text;
                    begin
                        PriceListHeader.SetRange("Price Type", PriceType);
                        PriceTypeFilterText := PriceListHeader.GetFilter("Price Type");
                        Evaluate(PriceSource."Price Type", PriceTypeFilterText);
                    end;
                }
            }
        }
    }
    var
        PriceType: Enum "Price Type";

}

3. Expected behavior
When you run the page it should allow you to pick one of the price types.
image

4. Actual behavior
I can choose standard value like Sales:
image
But not the extended value:
image

5. Versions:

  • AL Language: v9.0.615906
  • Visual Studio Code: 1.67.2
  • Business Central: 20.0.37253.38985

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