Jump to content

Type ahead search for portal


madman411

This topic is 3293 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 )
or
ClientTypeAhead ( 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 by madman411
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

This topic is 3293 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.