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

window.open no longer functions with Chrome/Edge update

(0) ShareShare
ReportReport
Posted on by 5

ISSUE:

The latest round of Google Chrome and MS Edge updates have made some of our custom Dynamics CRM code that uses window.DialogArguments to stop working and we cannot figure out why. It still works in Internet Explorer in Compatibility mode.

 

Dynamics CRM Version: 8.2.9.19 on premise

 

We have a ribbon button calling a javascript function SendEmail() which calls a pop-up window with a drop-down list box and a button. The javascript has an override function to replace the old window.showModalDialog function with a normal window.open

The problem seems to be that it’s no longer passing the arguments through and the window won’t even open.

// overrides showModalDialog, which was deprecated in Chrome and Firefox

// MW 6/4/2019

window.showModalDialog = function (url, arg, feature)

{

     var opFeature = feature.split(";");

     var featuresArray = new Array()

     if (document.all)

     {

               for (var i = 0; i < opFeature.length - 1; i  )

               {

               var f = opFeature[i].split("=");

               featuresArray[f[0]] = f[1];

               }

     }

     else

     {

            for (var i = 0; i < opFeature.length - 1; i  )

               {

               var f = opFeature[i].split(":");

               featuresArray[f[0].toString().trim().toLowerCase()] = f[1].toString().trim();

               }

     }

     var h = "200px", w = "400px", l = "100px", t = "100px", r = "yes", c = "yes", s = "no";

     if (featuresArray["dialogheight"]) h = featuresArray["dialogheight"];

     if (featuresArray["dialogwidth"]) w = featuresArray["dialogwidth"];

     if (featuresArray["dialogleft"]) l = featuresArray["dialogleft"];

     if (featuresArray["dialogtop"]) t = featuresArray["dialogtop"];

     if (featuresArray["resizable"]) r = featuresArray["resizable"];

     if (featuresArray["center"]) c = featuresArray["center"];

     if (featuresArray["status"]) s = featuresArray["status"];

 

     var modelFeature = "height = "   h   ",width = "   w   ",left="   l   ",top="   t   ",model=yes,alwaysRaised=yes"   ",resizable= "   r   ",celter="   c   ",status="   s;

     var model = window.open(url, "", modelFeature, null);

     model.dialogArguments = arg;

}

 

//Purpose: saves the form and shows html pop up with all the templates of email type

function SendEmail() {

  var popup = window.showModalDialog(Xrm.Page.context.getClientUrl()   "/WebResources/cmm_sendemail.htm", this, 'center:yes;unadorned:yes;resizable:1;dialogHeight:60px;dialogwidth:550px;scroll:no;status=no');

}

The HTML web resource cmm_sendemail.htm being called is below. The var entityName = window.dialogArguments.Xrm.Page.data.entity.getEntityName(); lines referring to window.dialogArguments are coming back as undefined in the browser console.

 



 

   

        Send Email

            

   

    

    

    

    

   

    

    

    
      Select Template :          



  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: window.open no longer functions with Chrome/Edge update

    Hello,

    You can use the approach that Microsoft's SDK uses internally - butenko.pro/.../

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 97

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans