Iam Working on Customer Lookup in case entity.customer want to show only contacts not accounts. i tried some code
lookfor: Contact is getting
but for lookin : account views are coming.how do you get contact views and to remove account views?could help on this
below is the screen shot
this is the code i used
function CustomerLookup() {
var View = Xrm.Page.getControl("customerid").getDefaultView();
Xrm.Page.getControl("customerid").setDefaultView("{A2D479C5-53E3-4C69-ADDD-802327E67A0D}");
Xrm.Page.getControl("customerid").addPreSearch(addFilter);
}
function addFilter() {
document.getElementById("customerid_i").setAttribute("lookuptypenames", "contact:2:Contact");
document.getElementById("customerid_i").setAttribute("lookuptypes", "2");
}
setDefaultview is also not setting.
help needed.
Thanks