Hello Everyone,
In one requirement in CRM 2011, we are supposed to prevent the user from selecting any of the existing records in Lookup field. Hence, I have tied a custom javascript to 'onclick' event of the lookup. This way, when the user clicks on the Magnifying Glass button of lookup field, the custom javascript opens the new popup using 'ShowModalDialog'. [Note: We need to pass certain parameters from this page to the popup as well, hence we are doing it by passing values in QueryString.]
The problem comes here: when the popup has opened, it works perfectly fine except that the 'Save'/'Save and Close'/'Save and New' buttons are enabled on the form but not clickable. I repeat: buttons show as Enabled, but when I try to click on them, nothing happens. All other form fields work fine. The other ribbon buttons are all disabled, which is fine by me. Refer below screenshot:
Desired behaviour: I need the 'Save'/'Save and Close' buttons clickable, so that when user saves and closes the dialog, the parent window can handle the ModalDialog result and populate the lookup using the newly created record id.
Here is how I have written the custom javascript code to open this ModalDialog:
var result = window.showModalDialog(url, null, "dialogHeight:800px;dialogWidth:1200px;center:yes; resizable:1;maximize:1;minimize:1;status:no;scroll:yes");
if (result != undefined) {
Xrm.Page.getAttribute("lookupfieldname").setValue(result);
}
I have tried below two types of URLs, and they both yield the same result (i.e. ribbon buttons not clickable in dialog, but rest of the form fields are working fine):
var url = http://servername/orgname/userdefined/edit.aspx?etc=10327¶m1=%7b353B4B04-9789-E311-9EAB-0050568C3FD5%7d¶m2=199988894377¶m3=%7b375BBBFE-687B-E211-9627-005056860003%7d¶m4=abc
var url = http://servername/orgname/main.aspx?etc=10327&extraqs=%3fetc%3d10327%26param1%3d%257b353B4B04-9789-E311-9EAB-0050568C3FD5%257d%26param2%3d199988894377%26param3%3d%257b375BBBFE-687B-E211-9627-005056860003%257d%26param4%3dabc&pagetype=entityrecord
Observations: If I open the same URLs in a separate browser window, then the ribbon buttons are clickable. Only when they are opened in modal dialog, they are not clickable.
Also, normally when you hover over the enabled/disabled buttons in the browser, they show the tooltip to you. Here, in the modal dialog, I do not see any tooltip on hover too. The other tabs on ribbon, such as File/Add/Customize are also not clickable. Hence, ribbon acts as if it is not there. :)
I am using CRM 2011 with Rollup 18. My IE browser version is 11.0.9600.18538. Client machine OS is Windows 8 (64-bit).
Could anyone suggest if this is a known issue with modal dialogs in CRM 2011? Is there any solution to it?