1

I have created a custom Modal Dialog Form for Contact Entity. The error occurs when I try to call Mscrm.Utilities... functions.

Console (Chrome) says: Uncaught ReferenceError: Mscrm is not defined(…)

I understand that I need to someway import or register this namespace to call its functions, but idk how to do this.

I have only following imports on my form:

<%@ Page language="c#" %>
<%@ Register TagPrefix="loc" Namespace="Microsoft.Crm.Application.Controls.Localization" Assembly="Microsoft.Crm.Application.Components.Application" %>

<%@ Import Namespace="Microsoft.Crm.Utility" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="Microsoft.Crm"%>

<%@ Register TagPrefix="crm" Namespace="Microsoft.Crm.Controls" Assembly="Microsoft.Crm.Application.Components.UI" %>
<%@ Register TagPrefix="sdk" Namespace="Microsoft.Crm.Application.Components.Sdk.FormControls.Web" Assembly="Microsoft.Crm.Application.Components.Sdk.FormControls" %>
<%@ Register TagPrefix="frm" Namespace="Microsoft.Crm.Application.Forms" Assembly="Microsoft.Crm.Application.Components.Application" %>

In standard Microsoft Dialog Forms the first line is like:

<%@ Page language="c#" Inherits="Microsoft.Crm.Web.Sfa.ContactDetailPage" %>

and this namespaces (Mscrm, Mscrm.Utilities, etc) I guess are coming from inherited class. But in my case I can't inherit any of this classes, cause I have custom dialog.

Raman Sinclair
  • 1,194
  • 17
  • 31
  • How is this loaded on the CRM webpage? – James Wood Sep 12 '16 at 07:22
  • `openStdDlgWithCallback(...)` from parent form. Here's arguements list from system .aspx file: `openStdDlgWithCallback(url, winArguments, width, height, functionReference, resizable, modeless, customWinParams)` – Raman Sinclair Sep 12 '16 at 07:35
  • So is your dialog in a web resource? – James Wood Sep 12 '16 at 08:09
  • @JamesWood, Yes it is. .aspx page. But it has no reference to my parent form, in other words, I didn't pass execution context to it, because chrome refuses to do this. Also, it seems to me that Chrome also refuses to bind callback function for my child form. – Raman Sinclair Sep 12 '16 at 15:01
  • 1
    @R.Matveev: HTML web resources only support plain HTML, not ASPX pages. I guess you are using internal components that are part of the Dynamics CRM product, which are not intended to be used for third party customizations. – Henk van Boeijen Sep 13 '16 at 16:57

0 Answers0