Search code examples
javascriptdynamics-crmdynamics-crm-2013dynamics-crm-2015dynamics-crm-2016

Xrm.Utility.openwebresource opens new tab


We have an onprem crm 2016. I'm opening an html webresource on a click of a ribbon button. I'm using Xrm.Utility.openWebResource(...). The problem with that is we're using IE11 and all users' browsers are configured to let IE decide how to open pop ups.

Guess what, IE decides to open a new tab! Is there a way to open an html web resource in a new window without changing the users' browser options?


Solution

  • Xrm.Utility.openWebResource() performs different in Chrome compared to IE11. Below options are there, pick it what suits you.

    1. window.open()

    2. Unsupported way to open modal dialog - showModalDialog

    3. Xrm.Internal.openDialog()

    Source

    Xrm.Utility.openEntityForm() has an option to mention as openInNewWindow = true in parameter windowOptions which is not available for openWebResource()