Your server URL is static. Use this code that generates URL dynamically, also with new release we figured out that URL with status=no
is not opening correctly, so we started to use status: no
and it became to work as expected. See the following code:
function TestRibbon(sLeadID) {
var DialogGUID = "6D128DF9-F51A-4D97-912D-C5A1FA4CEAFB";
// Get the CRM URL
var serverUrl = Xrm.Page.context.getServerUrl();
// Cater for URL differences between onpremise and online
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
}
serverUrl = serverUrl + "/cs/dialog/rundialog.aspx?DialogId=" + "%7b" + DialogGUID + "%7d" + "&EntityName=lead&ObjectId=" + sLeadID;
PopupCenter(serverUrl, "mywindow", 600, 500);
window.location.reload();
}
function PopupCenter(pageUrl, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
window.showModalDialog(pageUrl, title, 'status:no; scroll:no; resizable:no; dialogWidth: ' + w + 'px; dialogHeight: ' + h + 'px; dialogTop: ' + top + 'px; dialogLeft: ' + left + 'px;');
}
During investigation found this post for Ribbon Workbench for CRM 2011 Solution