业务流程中的查找过滤器
Lookup Filter in Business Process flow
我尝试更改字段 "Existing Contact?" 的查找过滤器(在销售线索流程中),但我无法访问此字段的 属性。
不幸的是,BPF 字段 属性 window 不可访问,查找字段 属性 无法像我们在表单部分中进行任何其他查找一样自定义。
但是有一种方法,我们可以使用 Javascript 来使用 addPreSearch
方法应用查找过滤器。这是完全支持的。 Read more
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);
}
}
}
我尝试更改字段 "Existing Contact?" 的查找过滤器(在销售线索流程中),但我无法访问此字段的 属性。
不幸的是,BPF 字段 属性 window 不可访问,查找字段 属性 无法像我们在表单部分中进行任何其他查找一样自定义。
但是有一种方法,我们可以使用 Javascript 来使用 addPreSearch
方法应用查找过滤器。这是完全支持的。 Read more
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);
}
}
}