May 12, 201510 yr Hi all I have a semi-working script to filter a portal in real time based on what the user begins to type to search within the portal. I've modified my filter calculation so many times I've ended up confusing myself. I have two filter requirements that need to work in conjunction with one another, regardless if the user is utilizing both filtering options. "Filter 1" is the type ahead field - a global (company search ahead) that uses a custom function, and "Filter 2" is a field with checkboxes - a global (company filter type) - that allows me to further filter based on the record's user entered status (company status). The filter calculation below works if the user types ahead and then applies the "filter type", however the found records displayed aren't always correct when I apply "filter 2", and I can't just utilize "filter 2" without something being typed into "filter 1". If someone can help me untangle myself from this mess I'd really appreciate it. Case( IsEmpty ( Company::Company Search Ahead )orClientTypeAhead ( Company::Company Search Ahead ; Company Selector::CompanyName ; 1 ) ; IsEmpty(Company::Company Filter Type) ; Company Selector::CompanyID = Company::CompanyID ; ValueCount ( FilterValues ( Company::Company Filter Type ; Company Selector::Company Status ) ) ) Edited May 12, 201510 yr by madman411
May 12, 201510 yr Treat the two filters (and their two respective states) as separate predicates. Try … ( IsEmpty ( Company::CompanySearchAhead ) or ClientTypeAhead ( Company::CompanySearchAhead ; CompanySelector::CompanyName ; 1 ) ) and ( IsEmpty( Company::CompanyFilterType ) or CompanySelector::CompanyID = Company::CompanyID ) i.e. ( Filter1Empty or Filter1Match ) and ( Filter2Empty or Filter2Match ) must be true for a record to pass muster. I left away the FilterValues() expression since I've no idea what it is supposed to do.
Create an account or sign in to comment