Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

CRM 2016 set default "Look for" entity and "Look in" view when using "Look Up Record" dialog

$
0
0

I know this has been asked multiple times and the general solution has worked fine until recently upgrading to CRM 2016 on premises.

Before I could set the default "Look for" entity and "Look in" view of the "Look Up Record" dialog using the following:

document.getElementById("customerid").setAttribute("defaulttype", "2");
Xrm.Page.getControl("customerid").setDefaultView("a2d479c5-53e3-4c69-addd-802327e67a0d");

This no longer works in CRM 2016 and I believe the source of the problem is explained here. Basically the new form rendering engine loads each script in separate iframes instead of the same frame as the form. This makes it so the document.getElementById() method can no longer find the element with the given name.

I tried using legacy form rendering and that allows the custom script to run successfully but the default view is still not correct when opening the dialog, although the default "Look for" entity is set. When I view the HTML source the defaultviewid attribute is not updated to the one I specified like it used to be in prior versions of CRM.

I would like to know a supported method using the new form renderer to set the default "Look for" entity in the "Look Up Record" dialog.

Is there a way to set the defaulttype attribute using the Xrm.Page API or some other way altogether to do this?

Below is the dialog I am referring to for reference.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>