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);
CurrPage.UPDATE(FALSE);
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.