Tuesday, 2 August 2016

Open Custom Dialog Box

Open Custom Dialog Box 


Challenge
We need to open the custom Web Resource in a Dialog Box. But the Dialog Box should look like other Dialog Box in CRM 2013.


 










Solution

Using one CRM Function:

Note: Here, URL must be without Server URL.

For the Parent Window:

 function CustomDialog()
{
var url = Xrm.Page.context.getClientUrl();
var vDialogOption = new Xrm.DialogOptions;
// Set height and width of the window
vDialogOption.width = 500; vDialogOption.height = 500;
Xrm.Internal.openDialog(url +"/WebResources/{use web resource name}", vDialogOption, null, null, CallbackFunction);
}

function CallbackFunction(returnValue){ }


In the Dialog Box, please include:

<script type="text/javascript" src="../../../../../../webresources/ClientGlobalContext.js.aspx"></script>

/*This Might change according to the url*/



Thanks

1 comment: