I have a basic BAQ called “CustomerCommentSearch” and it displays Customer.CustID and Customer.Comment.
In the BAQ, if I add a matches type criteria and set the specified constant to refused, I get all of the customers with “refused” somewhere in their comments… good.
HOWEVER, if I remove the BAQ matches criteria and add a matches condition / prompt criteria to the QuickSearch, I get get zero results… bad.
I’m typing in refused on the prompt window. Shouldn’t a QuickSearch wildcard work the same as a BAQ?
Have you tried the Matches criteria in Quick Search without adding wildcards to the search word? Ones that I have created do not require wildcards to be included with the search words.
In your experience, is there a way to replicate the default “description” search in a quick search? For example, the default search seems to work more like a Google search - return instances where all combinations of the search terms exist. However, in a quick search, matches or starts with doesn’t seem to work as well. Any suggestions?
Calvin,
Below is what I am referring to. A search with multiple words doesn’t work well with the matches condition. I’m hoping to replicate the functionality of the base search when entering multiple words.
Make a Pre-Proc BPM on Ice.QuickSearch.RunQuickSearchPaged. Use a Set Field widget to update the value of ttQuickSearchCriteria.CriteriaValue, replacing the spaces with percent signs.
I am trying to apply this same concept to tweaking my Task List so that it doesn’t always filter by the sales rep that is entered. We want to display all tasks in that view. Would you still replace the text with % signs? Or would I just wipe the salesrepcode out altogether so that it’s not being filtered at all?
This is a great start. It does exactly what we thought it would do with a #12 white search…
I am hoping to go a step further, now. I believe this forces us to enter the search terms in the order that they appear in the description. Essentially, our search criteria ends up looking like:
WHERE Part.PartDescription LIKE '%#12%WHITE%'
so it’s looking for #12 to appear in any position with white in any position after it.
Any thoughts on how we might trick it to search for either in any position?
It would be more complicated than just taking the users search string and replacing spaces with percent signs. And might not be possible, since it is search criteria, and not a true WHERE clause.
If you have access to the where clause, you could convert the search phrase into several parts, and build a complex where clause. For example, searching for
Hello there world
would need a where clause like
(Desc = '%Hello%there%world%') OR (Desc = '%Hello%world%there%')
OR (Desc = '%world%Hello%there%') OR (Desc = '%world%there%Hello%')
OR (Desc = '%there%world%%Hello%') OR (Desc = '%there%Hello%world%')
You’d need to split it into the number of words, then iteratively build the phrase of every possible combo. The number of combos’ is the factorial of the number of 3 words. For 3 words, it would be 3! = 6. The combos are:
1-2-3
1-3-2
2-1-3
2-3-1
3-1-2
3-2-1
I am experimenting with iterative searches as we speak. I have learned that I can programmatically set the existing criteria value to whatever I want (custom code). No surprise there…
My plan is to split the description on the spaces and the loop through each term and dynamically create a new criteria for each separate term. It should treat them like an “AND” in the WHERE so it should end up something like having 2 or 3 or 4 separate part description boxes with one word in each. Fingers crossed.
I’ve been able to use the .Add(row) method to the ttQuickSearchCriteria table but it only seems to accept the final row I add. In other words, if I create a search for “rubber elbow”, I get all results as though I only typed “elbow”. If I reverse those, I get results as though I only typed “rubber”. Is there a trick to get it to accept multiple rows? Should I be including something after the Add method (like an Update or something)? See below snippet from my method directive on Ice.QuickSearch.RunQuickSearchPaged: