Hi all
I have a custom field that has the customer type. On a specific form, I want to filter this lookup to include only accounts and contacts that have a specific value in a custom field that has the same name on both entities. I have written the following JavaScript to accomplish this:
function OnLoad(executionContextObj) {
debugger;
var formContext = executionContextObj.getFormContext();
formContext.getControl("pit_recipient").addPreSearch(ApplyRecipientsOnlyFilter);
};
function ApplyRecipientsOnlyFilter(executionContextObj) {
debugger;
var filter = "<filter type='and'>" +
"<condition attribute='pit_isarecipient' operator='eq' value='1' />" +
"</filter>";
var formContext = executionContextObj.getFormContext();
formContext.getControl("pit_recipient").addCustomFilter(filter);
};
On the standard Web client, this works exactly as expected.
But in the custom app we have created for our users, the ApplyRecipientsOnlyFilter() method is not even called and the accounts and contacts are not filtered as expected.
Can anyone help me fix this issue please?
Thanks
Ashley Visagie