sorry for late reply
here my code is
function oncategory_change(){
debugger;
if(Xrm.Page.getAttribute("new_category").getValue() == null){
Xrm.Page.getAttribute("new_casetype").setValue();
casetype_onload();
Xrm.Page.getAttribute("new_casesubtype").setValue(null);
}
else
{
casetype_onchange_filter();
}
}
////////Double Lookup Filter
function casetype_onchange() {
debugger;
// add the event handler for PreSearch Event
Xrm.Page.getControl("new_casetype").addPreSearch(function() { addFilter() });
}
function addFilter() {
var categoryIdn = Xrm.Page.getAttribute("new_category").getValue() != null ? Xrm.Page.getAttribute("new_category").getValue()[0].id : null;
var oemId = Xrm.Page.getAttribute("new_oem").getValue() != null ? Xrm.Page.getAttribute("new_oem").getValue()[0].id : null;
//var categoryIdn = categoryId.toUpperCase();
ar filter = "<filter type='and'><condition attribute='new_category' operator='eq' value='" + categoryIdn + "' /><condition attribute='new_oem' operator='eq' value='" + oemId + "' /></filter>";
Xrm.Page.getControl("new_casetype").addCustomFilter(filter);
}
/////////single Lookup Filter
function casetype_onload(){
debugger;
Xrm.Page.getControl("new_casetype").removePreSearch(function() { addFilter() });
Xrm.Page.getControl("new_casetype").addPreSearch(function() { Filtercasetype() });
}
function Filtercasetype(){
Xrm.Page.getControl("new_casetype").removePreSearch(function() { addFilter() });
var oemId = Xrm.Page.getAttribute("new_oem").getValue() != null ? Xrm.Page.getAttribute("new_oem").getValue()[0].id : null;
var fetch = "<filter type='and'><condition attribute='new_oem' value='"+oemId +"' operator='eq'/></filter>";
Xrm.Page.getControl("new_casetype").addCustomFilter(fetch);
}