
Hi Experts,
I have a scenario in which i want to open a page in a repeat untill loop , and right after opening that page want to close it immediatly!!
Since, there is some code written on OnOpenPage, OnAfterGetRecord triggers on that page and loaded some fields values on that page. So after executing this code on the mentioned triggers i can get values from the table that the page based on.
But i can open the page but cant close through the code.
Any idea, is it possible or not?
Hello,
To be honest if I were you I would consider if there are different ways to achieve the same - check the code on this page and replicate what you need, rather than running the page just to run the code on that page.
If you do need to open then retrieve som data, then close it again, maybe a structure like this could work:
Declare the page as a variable:
var
ClosePage : Page "My Close Page"
Then run it, retrieve some data, then close it:
ClosePage.Run;
My Txt := ClosePage.GetData;
ClosePage.Close;
GetData is a function on the page that Exits the data you want to exit.
I am pretty unsure if this will actually work, but that's the method I would try second (my first try would be to consider a differen approach).