BusinessCentral.LinterCop icon indicating copy to clipboard operation
BusinessCentral.LinterCop copied to clipboard

(LC0005) Shows double in list of Warnings

Open Arthurvdv opened this issue 2 years ago • 0 comments

image

image

A small code-snippet to reproduce the problem:

tableextension 50100 "VRA G/L Entry" extends "G/L Entry"
{
    internal procedure GetCountryRegionCodeTxt(): Text
    var
        PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
    begin
        case Rec."Document Type" of

            // Credit Memo (Sale or Purchase)
            Rec."Document Type"::"Credit Memo":
                case Rec."Gen. Posting Type" of

                    // Purchase Credit Memo
                    Rec."Gen. Posting Type"::Purchase:
                        begin
                            purchCrMemoHdr.SetLoadFields("Buy-from Country/Region Code");
                            if not PurchCrMemoHdr.Get(Rec."Document No.") then exit;
                            exit(PurchCrMemoHdr."Buy-from Country/Region Code");
                        end;
                end;
        end;
    end;
}

Arthurvdv avatar Apr 28 '22 13:04 Arthurvdv