Monday, May 26, 2014

Show your dialog in CRM 2013 modal style

With CRM 2013 we have got one working window without any pop-up windows (lookups, dialogs, e.t.c.). But… only for standard features. What to do in case you wanted to use the same approach with modal windows as CRM does it? I walked through SDK and found following article - I tried the code but I have got wrapped method. After some investigations I found how CRM does it:
if (typeof Custom == "undefined") {
    Custom = {
        OpenDialog: function (webresource) {
            var $v_0 = new Mscrm.CrmDialog(Mscrm.CrmUri.create(webresource), window, 370, 370, null);
        __namespace: true

and usage is following:


Demonstration of how it looks like:

You can use this approach but remember that this code uses undocumented methods so it could be broken with any rollup.