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

LC0027: Handle on Variant as Table, with Supported Page

Open Arthurvdv opened this issue 7 months ago • 0 comments

Extend the LC0027 rule to also raise a diagnostic in case when a Variant is passed in combination with a Page which is supported by the Page Management codeunit.

Example

    local procedure HandleError(MyErrorInfo: ErrorInfo)
    var
        RecRelatedVariant: Variant;
    begin
        RecRelatedVariant := MyErrorInfo.RecordId.GetRecord();
        
        case MyErrorInfo.TableId of
            Database::Resource:
                Page.Run(Page::"Employee Card", RecRelatedVariant);
        end;
    end;

Arthurvdv avatar Jul 12 '24 14:07 Arthurvdv