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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,986 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,071 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 975 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans