Hi Guyz..
I am a beginner working in crm. I just want to filter look up using addpresearch function. In contact i have two fields state and city. I want to filter City based on the state. I have written the code but i am getting error as
unable to get addPresearch function.
function preFilterLookup() {
Xrm.Page.getControl("new_city").addPreSearch(function () {
addLookupFilter();
});
}
function addLookupFilter() {
//check if the city is not empty
var state = Xrm.Page.getAttribute("new_state").getValue();
//create a filter xml
var filter= "<filter type='and'>" +
"<condition attribute='new_state' operator='eq' value='" + state + "' />" +
"</filter>";
//add filter
Xrm.Page.getControl("new_city").addCustomFilter(filter);
}
*This post is locked for comments