SetFilter in enum Flowfiter

Hi,

I am trying to Copy an enum Value from the GenJournalBatch to a Flowfilter Field in the GenJournalLine.

I tried so far something like:

trigger OnOpenPage()

var
GenJnlBatch: Record General Journal Batch

begin

Rec.SetFilter(“Transaction Type Filter”, ‘%1’, GenJnlBatch.“Transaction type”::Value1)

end

However it only seems to work with text filter.

Anybody has an idea?

Thanks!!

In order to copy an enum value from the GenJournalBatch to a Flowfilter Field in the GenJournalLine, you can try the following code:

trigger OnOpenPage()

var
GenJnlBatch: Record “General Journal Batch”;
GenJnlLine: Record “General Journal Line”;

begin
GenJnlBatch.SetRange(“No.”, GenJnlLine.“Journal Batch Name”);
GenJnlBatch.SetRange(“Line No.”, GenJnlLine.“Line No.”);
GenJnlBatch.Find(‘-’);

GenJnlLine.“Transaction Type Filter”.Value1 := GenJnlBatch.“Transaction type”;

end

This code first sets the range of the GenJnlBatch record to match the current GenJnlLine record. It then finds the corresponding GenJnlBatch record, and finally sets the value of the “Transaction Type Filter” FlowFilter field on the GenJnlLine record to the value of the “Transaction type” enum field on the GenJnlBatch record.

Note that this code assumes that the “Transaction Type Filter” field is of type FlowFilter, and that the “Transaction type” field is of type Enum.