Hi,
I want to filter a lookup on form using Optionset. I tired using addcustomfilter but nothing worked. "filter" is event being called onload event
function filter (executionContext) {
// get the form context
formContext = executionContext.getFormContext();
formContext.getControl("new_lookup").addPreSearch(filterCustomerAccounts);
}
function filterCustomerAccounts() {
var option = formContext.getControl("new_options").getValue();
if (option = 100000001) {
var customerAccountFilter = "<filter type='and'><condition attribute='telephone1' operator='begins-with' value='55'/></filter>";
formContext.getControl("new_lookup").addCustomFilter(customerAccountFilter, "account");
}
else {
var customerAccountFilter = "<filter type='and'><condition attribute='name' operator='begins-with' value='T'/></filter>";
formContext.getControl("new_lookup").addCustomFilter(customerAccountFilter, "account");
}
}
*This post is locked for comments