遗憾的是,BPF字段属性窗口无法访问,并且查询字段属性不能像我们在表单部分进行其他查询一样进行自定义。
但是有一个方法,我们可以使用Javascript来应用查找过滤器,使用的方法是 addPreSearch
方法。这是完全支持的。阅读更多
function filterBpfLookup = function(formContext){
if (formContext.getControl("header_process_mag_contactlookupid") != null){
formContext.getControl("header_process_mag_contactlookupid").addPreSearch(filterDefinition);
}
}
function filterDefinition = function(formContext) {
var accountId = null;
var accountLookup;
var filterBpf;
if (formContext.getControl("header_process_mag_contactlookupid") != null &&
formContext.getControl("header_process_mag_contactlookupid").getAttribute().getValue() != null){
accountLookup = formContext.getControl("header_process_mag_accountlookupid").getAttribute().getValue();
accountId = accountLookup[0].id;
if (accountId != null || accountId != undefined){
filterBpf = "<filter type='and'>" +
"<condition attribute='mag_accountlookupid' operator='eq' value='" + accountId + "' />" +
"</filter>";
formContext.getControl("header_process_mag_contactlookupid").addCustomFilter(filterBpf);
}
}
}