LC0058 - StefanMaron/BusinessCentral.LinterCop GitHub Wiki

PageVariable.SetRecord(): You cannot use a temporary record for the Record parameter.

The goal of this rule is to deal with the record parameter of the PageVariable.SetRecord() procedure which cannot use a temporary record for the Record parameter.

You cannot use a temporary record for the Record parameter
Source Page.SetRecord(var Record) Method - Business Central | Microsoft Learn

Example

local procedure MyProcedure()
var
    TempCustomer: Record Customer temporary;
    CustomerCard: Page "Customer Card";
begin
    // ...
    // Lots of code here
    // ...

    CustomerCard.SetRecord(TempCustomer); // This will raise the diagnostic
    CustomerCard.Run();
    end;