madman411 Posted May 12, 2015 Posted May 12, 2015 (edited) 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, 2015 by madman411
eos Posted May 12, 2015 Posted May 12, 2015 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. 1
Recommended Posts
This topic is 3483 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now