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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Is it possible to close the web browser tab using X++ code in D365 F&O

(0) ShareShare
ReportReport
Posted on by

Hi,

I am opening URL from D365 F&O using Browser class in the Form button click.

browser().navigate("URL", true);

When I am performing the button click again it should close the existing tab (URL) in browser and it should navigate to new the tab. Is it possible to close the web browser tab using X++ code in D365 F&O?

Thank you in advance.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Nope, I don't think so. D365FO doesn't have any hook / link to the newly opened tab. It's easy for the system to ask the browser to open one new tab. But to close a specific tab - even if technically possible - you should have some pointer to that tab or you could not tell which tab to close.

    Basically the user can close the tab when they don't need it anymore.

  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi NagarajanRajan,

    Not sure if I understood your requirement completely, but if you want to open details in a new tab and close the old tab, can you then just simply use browser().navigate("URL", false) to open the new page in the current tab?

  • Community Member Profile Picture
    on at

    Hi André,

    Thanks for you response.

    If I use browser().navigate("URL", false) , it is opening the URL in the same D365 F&O tab. So the next time I have to go back to F&O to perform button click again. (It is fetching some data from F&O to the URL)

    The requirement here is whenever we are performing the button click it should open new tab and previously opened tab should be closed (It is like refreshing the URL every time). Because of too many opened tabs in browser, it is creating confusion to the users and users are not ready to close it manually :)

  • Verified answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Hi NagarajanRajan,

    as mentioned before, this is not possible.

    You can either open the URL in the existing browser tab, or a new one. But you can't afterwards close browser tab(s) that were opened from some specific D365FO session. D365FO simply doesn't have any way of knowing / accessing those tabs. It simply sent a request "browser, please open this URL in a new tab" and that's it. The browser didn't reply "ok, here's some unique ID for the tab, and you can later close it if you know this id".

    It's a "fire and forget" kind of call.

    Can you explain your business requirement? What are these new URLs that you are launching?

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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans