Skip to content
Arthur van de Vondervoort edited this page Jun 10, 2024 · 2 revisions

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;
Clone this wiki locally