Reputation: 1072
I have custom application with active use of CRM lookups.
I can open CRM lookup from my JS like this:
function OpenLookup() {
var url = "http://CRM_SERVER_NAME/ORG/_controls/lookup/lookupsingle.aspx?class=null&objecttypes=2&browse=0&ShowNewButton=0&ShowPropButton=1&DefaultType=0";
var lookUp = window.showModalDialog(url, "entity",..);
...
}
How can I setup customView on lookup (typically it can be done using addCustomView(..)
but I can't call any CRM Javascript (no CRM Javascript model on my form). Is this any way to do this?
I'm perfectly happy with any unsupported method.
Upvotes: 1
Views: 652
Reputation: 548
Just a silly (or not) idea. The lookup comes from an existing entity form so … why not open this CRM form (the inner IFRAME edit.aspx not the main.aspx) inside an IFRAME (hidden, resized) in your custom application ,wait until it loads and open the lookup from inside this IFRAME. This way you have access to the entire Xrm.Page model including addCustomView. You may also attach to this lookup field change event to get the selected value. To make the IFRAME load fast you can create a new role form with only the lookup/s you need to pop and use this in your IFRAME.
Upvotes: 1