Источник:
http://mscrmtools.blogspot.com/2011/...p-onclick.html
==============
I know that some of you can’t wait to know how to override lookup control onclick event. Indeed, Microsoft has heavily used htc file for their controls behavior and it’s more difficult to change these behaviors than it was in Dynamics CRM 4.0…
So, here is the solution:
var element = document.getElementById("lookup_attribute_logicalname");
element.onshowdialog = function (event) {
var url = "http://you_custom_page_url" ;
var result = window.showModalDialog(url);
event.oLookupItems = { items: result };
};
The object returned from the page should be an array of Lookup items, like the following (example for an account):
var lookupItems = new Array();
lookupItems[0] = new Object();
lookupItems[0].id = "{...}"
lookupItems[0].name = "My account";
lookupItems[0].type = 1;
lookupItems[0].entityType = "account";
window.returnValue = lookupItems;
To be honest, I’m not the one who found this solution. All the credit goes to my colleague Nicolas.
Источник:
http://mscrmtools.blogspot.com/2011/...p-onclick.html