0

I'm having a problem using window.opener from a custom web site opened by a button in CRM Ribbon. I'm using Dynamics CRM 2016 on-premise.

In details: From a button in the Quote entity of CRM ribbon I open a custom page with window.open(...), in this page I want to reload the opener page (the quote in CRM). I can do this in the web client with window.opener, however when using Outlook Client I get window.opener is undefined. I tried lots of combinations like window.parent.opener | window.top.opener | window.parent.top.opener but nothing seems to work.

Do you have any idea why the window.opener is empty in CRM for Outlook but works in the web? Do you have any ideas on a workaround for this issue? The requirement is to reload the quote after some work is done on this custom page.

Any help would be appreciated.

Thanks!

  • I'm not surprised that window.opener doesn't work in Outlook...the add-in or Outlook might restrict window communication. Does window.open return anything? If it does, maybe you could inspect the object that it returns to see if you can use it to somehow detect that the user closed the window. – Polshgiant Apr 26 '16 at 19:29
  • Thanks for your comment. I tried to inspect most elements and all of them have the opener empty. Do you know how can I make the rescrition to go away? I tried to add the sites to the trusted sites but with no luck – Andrefv.correia Apr 27 '16 at 08:36
  • I don't know that you'll find one. One thing you could try: `var x = window.open('someurl'); x.opener = window;`. – Polshgiant Apr 27 '16 at 12:26

1 Answers1

0

Try refreshing the pop-up once. Hopefully window.opener will be accessible once the window is refreshed.