Here is a short code sample on how to add a pre-search filter to the lookup
function onLoad()
{
Xrm.Page.getControl(…).addPreSearch(function () { addPreSearchFilter(); });
}
function addPreSearchFilter()
{
var filter = “<filter type=’and’>” +
“<condition attribute=’…’ operator=’not-null’/>” +
“</filter>”;
Xrm.Page.getControl(…).addCustomFilter(filter);
}