Skip to content
Arthur van de Vondervoort edited this page Apr 6, 2024 · 1 revision

Empty Enum values should not have a specified Caption property

This rule checks if the value of the Enum is empty ("") while the Caption property is not empty. The intent of having an empty Enum value can be ambiguous, as such values are not accessible with AL code and also not displayed in the (web)client.

Example

enum 50100 "My Enum"
{
    value(0; "") // This will raise the diagnostic
    {
        Caption = 'New';
    }
    value(1; "") // Omitting the caption property will not raise a diagnostic
    {

    }
    value(2; "") // An Empty caption will not raise a diagnostic
    {
        Caption = '';
    }
    value(3; " ") // An non-Empty Enum value (space) will not raise a diagnostic
    {
        Caption = 'New';
    }
}