If you want to restrict a lookup for the data type of customer there is a very simple way and it is not using prefiltering.
Simple JavaScript and a few lines of code will provide this functionality.
var formContext;
function onLoad(executionContext) {
formContext = executionContext.getFormContext();
filterCustomerLookup();
}
function filterCustomerLookup() {
var customer = formContext.getControl('customerid');
if (customer.getEntityTypes().length > 1) {
customer.setEntityTypes(['account']);
}
};
Leave a Reply