Sunday, 22 May 2016

How to call dialogs in javascript in MS CRM

Opens the specified dialog for a particular record in a CRM light-box, or Modal Dialog if run from Outlook. Once the dialog is closed, a custom callback function can be executed, e.g. to refresh the form with new data set by the dialog.

Parameters: Dialog ID/Guid, Entity Name, Record ID/Guid, Callback function, CRM Base URL (not required on forms/views)


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Process.callDialog("C50B3473-F346-429F-8AC7-17CCB1CA45BC", "contact", 
Xrm.Page.data.entity.getId(),
function () {
Xrm.Page.data.refresh();
});
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Don't forget to import Processjs solution into your CRM instance provided by codeplex to make it work.

Note: To not make the GUID of Dialog hard-coded, you can fetch GUID of workflow from it's name using Odata/Web code.

No comments:

Post a Comment