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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to unload an IFrame and auto close HTML web resource upon exiting embedded Canvas App?

(0) ShareShare
ReportReport
Posted on by 10

Hello All, 

I have a canvas app embedded into MS CRM using an IFrame within an HTML Web Resource. This web resource will be called using a JavaScript function on a button click, and I'm using  XRM.Navigation.navigateTo open this web resource.

I have a submit button in embedded canvas app which will insert some data into one of the entities and upon inserting the data, the embedded app will auto close using an Exit() functoin in canvas app itself.

Now, my question is, how can I close the opened HTML web resource automatically once the canvas app exits. I did some debugging and found out the IFrame is not unloading once the canvas app exits due to cross domain issue. 

Thanks in advance

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    See below link.

    butenko.pro/.../

    Unfortunately there is only unsupported way to close dialog at the moment. Following code can be used to close it:

    parent.$("button[data-id='dialogCloseIconButton']", parent.document).click();

    In order to return data from dialog set returnValue of window object in dialog and include parameter to “resolve” handler of promise in calling code.

    If found helpful, Please mark my answer verified.

  • MahakJain Profile Picture
    65 on at

    Did you get any solution for closing HTML when we EXIT() Canvas App?

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 > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans