web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Page.Close, once its opened from a different page

(0) ShareShare
ReportReport
Posted on by 220

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?

I have the same question (0)
  • Lars Lohndorf-Larsen Profile Picture
    on at

    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).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,472

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 742 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 684 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans