clear setselectionfilter

This is probably a rookie question but I can not seem to figure out the best way to do this.

I want to run a process on selected sales lines from the sales order form.

I have added a menu item on the sales order form that looks to the sales order subform.

The code is on the subform is

CurrForm.SETSELECTIONFILTER(Rec);
REPORT.RUN(50094,FALSE,FALSE,Rec);

The report is a processing report that does some work with the selected sales lines.

My problem is that when the processing is done and the user is returned to the sales order form, the form only shows the lines he selected and has to click “showall” to see all the lines again.

How can I clear the seletionfilter automatically?

please use a second variable with type Record and same subtype as Rec.

Rec2.COPY(Rec);
CurrForm.SETSELECTIONFILTER(Rec2);
REPORT.RUN(50094,FALSE,FALSE,Rec2);

With this solution you don’t have to clear the setselectionfilter.