Dialog: How to call using JScript CRM 2011

Microsoft Dynamics CRM is a Customer Relationship Management software package developed by Microsoft
Post Reply
User avatar
gellee
Posts: 46
Joined: Fri Jan 20, 2012 3:04 pm

Dialog: How to call using JScript CRM 2011

Post by gellee »

1. We need to find out the ID of the Dialog. This could be attained in 2 ways.
a. Search with Dialog name in Customizations.xml located in your solution
b. Open the Dialog and press F11 to get the URL.

Javascript Code

Code: Select all

function opendialogonload() 
{
    window.open("/" + "cs/dialog/rundialog.aspx?DialogId=%7bA5ACE0AD-EE1C-4E02-BB2F-F8BC139A90FD%7d&EntityName=lead&ObjectId=" + Xrm.Page.data.entity.getId());
}
>>In this example, the dialog is being executed on Lead Entity with a dialog ID of %7bA5ACE0AD-EE1C-4E02-BB2F-F8BC139A90FD%7d.

If you have to select a specific row in view to display the dialog, use the code below and call it in a custom ribbon.

Code: Select all

function DisplayDialog() 
{

     var selectedrecords = document.all['crmGrid'].InnerGrid.SelectedRecords;

     for (var i = 0; i < selectedrecords.length; i++) 
     {

             window.open("/" + "cs/dialog/rundialog.aspx?DialogId=%7bF6056C48-4F59-4FE8-882E-E219B56B4EEF%7d&EntityName=new_alert&ObjectId=" + selectedrecords[i][0]);

     } 

}
xaeresis
Posts: 196117
Joined: Wed Oct 04, 2023 2:39 pm

Re: Dialog: How to call using JScript CRM 2011

Post by xaeresis »

xaeresis
Posts: 196117
Joined: Wed Oct 04, 2023 2:39 pm

Re: Dialog: How to call using JScript CRM 2011

Post by xaeresis »

Post Reply