Strange Sub-Page Update Behaviour After Refresh

I have a strange behaviour on one of my pages on Microsoft Dynamics NAV 2009.

I have a page and placed a sub page on it. I created a function on the sub page SetView(VAR recSTA : Record “Ship-to Address”);

I then set Rec.COPY(recSTA);

On the sub-page.

On the main page I call the function at the OnAfterGetRecord function. I need to call the function on this trigger, because the record I pass to it, relies on information I only get on the OnAfterGetRecord function.

When I open the page, everything is fine. I get two lines as a result on the sub page which is correct.
However, when I refresh the main page (let’s say by pressing F5 or somwhere by CurrPage.UPDATE) I get the wrong result.

I debugged the SetFilter with MESSAGE-boxes, the count of Rec is 2, however the count of the result is >1000

I guess I need an additional CurrPage.UPDATE after calling the sub-page SetView, but I can not call UPDATE in OnAfterGetRecord because it will call OnAfterGetRecord, so I get an endless loop

BTW: I have another sub page on the same main with a temporary table and a SetView function. There I get the correct result.

Even if I am changing Rec.COPY(recSTA); with Rec.RESET;Rec.SETFILTER(“Customer No.”, no); I get the same behavior. The first time I open the page everything is correct, as soon as I refresh the page, the results get false. I somehow need to get an CurrPage.UPDATE in place

I have created a Action with CurrPage.UPDATE; on the parent page.

If i press F5, I get the wrong errorneous behavior. If I press the new Action (with CurrPage.UPDATE;) is get the right results.

Can I overwrite the default F5 behaviour?

When I press AssistEdit button (doesn’t matter which one on the page), even if there is no code behind the AssistEdit, I get the correct result as long as I don’t refresh the page.

Something is totally wrong here.

I found a “temporary” solution. I set the SubFormVView of the part in main page to a dummy sorting and a dummy const value

SORTING(Customer No., Code) WHERE(Customer No.=CONST(1))

and in addition I set the SubFormLink also to Customer No:=FIELD(“No.”);

and then it works also after a F5