StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
77 stars 31 forks source link

False Positive LC0044 (Conflicting ID, Name or Type with Table 'Value Entry') for Enum Data Type #432

Closed pri-kise closed 10 months ago

pri-kise commented 10 months ago

We have a table where we use TransferFields to Copy Values from table 5802 "Value Entry". Now I receive a warning for the following field defintion:

table 50000 "PTE Custom Entry"
{
    fields
    {
        field(1; "Entry No."; Integer)
        {
            Caption = 'Entry No.';
            DataClassification = CustomerContent;
        }
        field(2; "Item No."; Code[20])
        {
            Caption = 'Item No.';
            DataClassification = CustomerContent;
            TableRelation = Item;
        }
        field(3; "Posting Date"; Date)
        {
            Caption = 'Posting Date';
            DataClassification = CustomerContent;
        }
        field(4; "Item Ledger Entry Type"; Enum "Item Ledger Entry Type")
        {
            Caption = 'Item Ledger Entry Type';
            DataClassification = CustomerContent;
        }
    }
}

image

table 5802 "Value Entry"
{
    Caption = 'Value Entry';
    DrillDownPageID = "Value Entries";
    LookupPageID = "Value Entries";

    fields
    {
        field(1; "Entry No."; Integer)
        {
            Caption = 'Entry No.';
        }
        field(2; "Item No."; Code[20])
        {
            Caption = 'Item No.';
            TableRelation = Item;
        }
        field(3; "Posting Date"; Date)
        {
            Caption = 'Posting Date';
        }
        field(4; "Item Ledger Entry Type"; Enum "Item Ledger Entry Type")
        {
            Caption = 'Item Ledger Entry Type';
        }

I think that the problem might be caused by the Enum data type, since I receive this warning several times.

Arthurvdv commented 10 months ago

@tinestaric has provided an solution, where we think we have solved this.

Can you try the updated (pre)release v0.30.10 version of the LinterCop and see if this makes any difference?

Arthurvdv commented 10 months ago

The v0.30.10 version of the LinterCop is now released, where I think this issue was resolved in the meantime. If you still encounter issues, feel free to reopen this issue (of create new one).