Search code examples
dialogdynamics-crmdynamics-crm-2013

Dynamics CRM Dialog hangs/freezes when called via script


when dialog process is called from a script that is embedded on a ribbon button, The dialog freezes and enter into a not responding state.


Solution

  • I just figured out that When calling the dialog via script check the ObjectId Guid that it passes. If the provided Guid does not exist on CRM Database the dialog will hang without giving any error. This may happen if you want to create a dialog that do not need a entity record to run against. In this type of case you just want an inactive record to appointed as ObjectId.

    function CallDialog()
    {
      var clientId = Xrm.Page.context.getClientUrl();
      var url = clientId + "/cs/dialog/rundialog.aspx?DialogId=%7b460ACCDC-701C-4947-8E72-CDE2C53807FC%7d&EntityName=EntityName&ObjectId=%7b115fbb02-b5a5-e711-8122-005056b32967%7d";
      window.open(url,"", "width=700,height=600");
    }