Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Extensibility Request: Replace Option with Enum on Page 7004 "Sales Line Discounts" #30170

Closed

Description

Why do you need this change?

On Page 7004 "Sales Line Discounts", the variable is currently defined as an Option, which prevents extensibility.
ItemTypeFilter: Option Item,"Item Discount Group","None";

As this variable is an Option type:
It cannot be extended in extensions
Custom solutions that require additional values must implement workarounds
This limits flexibility and leads to non-upgrade-safe customizations

Benefits
Enables partners to extend filtering options
Improves upgrade safety

Use Case
Our customization requires adding additional filter types, which is currently not possible without replacing standard logic.

Describe the request

Replace the Option type with an extensible Enum, for example:

enum 50XXX "Item Type Filter"
{
    Extensible = true;

    value(0; Item) { }
    value(1; "Item Discount Group") { }
    value(2; None) { }
}

and update the variable inside page
ItemTypeFilter: Enum "Item Type Filter";
Internal work item: AB#637944

Activity

  1. added
    SCM
    enum-request
    on May 27, 2026
  2. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    ✅ Analysis complete - ready for further processing


    Implementation:

    Add a new extensible enum Item Type Filter with the values Item, Item Discount Group, and None, and update page Sales Line Discounts to use ItemTypeFilter: Enum "Item Type Filter";.

    field(ItemTypeFilter; ItemTypeFilter)
    {
        ApplicationArea = Basic, Suite;
        Caption = 'Type Filter';
        ToolTip = 'Specifies a filter for which sales line discounts to display.';
    
        trigger OnValidate()
        begin
            ItemTypeFilterOnAfterValidate();
        end;
    }
    
    protected var
        CodeFilter: Text;
        CurrencyCodeFilter: Text;
        SalesCodeFilter: Text;
        SalesTypeFilter: Option Customer,"Customer Discount Group","All Customers",Campaign,"None";
        ItemTypeFilter: Enum "Item Type Filter";
        StartingDateFilter: Text[30];
    
    namespace Microsoft.Sales.Pricing;
    
    enum 7022 "Item Type Filter"
    {
        Extensible = true;
        AssignmentCompatibility = true;
    
        value(0; Item)
        {
            Caption = 'Item';
        }
    
        value(1; "Item Discount Group")
        {
            Caption = 'Item Discount Group';
        }
    
        value(2; None)
        {
            Caption = 'None';
        }
    }

    File: SalesLineDiscounts.Page.al

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  3. added
    enum-request
    and removed
    enum-request
    on May 28, 2026
  4. added
    enum-request
    and removed
    enum-request
    on Jun 8, 2026
  5. exnihiloo commented on Jun 11, 2026

    @exnihiloo
    Author

    Hello, is this approved for implementation?

  6. AleksandricMarko commented on Sep 3, 2026

    @AleksandricMarko
    Contributor

    Hello exnihiloo,

    Did you try to hide ItemTypeFilter and add your field which will validate ItemTypeFilter?
    It will not have proper descriptive values in code, but seems you can accomplish desired

  7. exnihiloo commented on Sep 3, 2026

    @exnihiloo
    Author

    Marko Aleksandric (@AleksandricMarko)

    hello, I also added event requests : #30173
    those event requests are related to ItemTypeFilter because it uses additional values on filtering

  8. AleksandricMarko commented on Sep 7, 2026

    @AleksandricMarko
    Contributor

    Hi,

    New event is implemented with ItemType filter as integer as I can see.
    I know it is not ideal solution, but still seem it can be used as is, without new enum?

  9. exnihiloo commented on Sep 9, 2026

    @exnihiloo
    Author

    Hello, Marko Aleksandric (@AleksandricMarko),

    Yes we can use new implementation. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMenum-request

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions