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 :
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,983 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

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans