views:

65

answers:

2

The default search box in a LightSwitch screen is very neat - all set up for you and it searches almost everything. But is there a way to filter the result set on a boolean column? Or more than one boolean column? Is there an advanced search syntax, or is it just a super simple search for strings? Maybe I missed something in the documentation?

Note I'm using the first beta.

+2  A: 

One way is to create your Search Data Screen and press the "Edit Query" next to the TaskCollection, on the left column. Enter your boolean constraints and save. Your screen will be 'filtered' before being displayed.

Another way is to create a new query from your entity and base the new screen on it. Select an entity and choose "Query" from its Title/Add bar. Name your query and enter your boolean constraints. Choose "Add Screen" from this query's Title bar and create your Search Data Screen.

The latter may be useful if you want to re-use your boolean constraints.

Rusty
Maybe I wasn't specific enough - I want the user to do the filtering, not the developer. Adding screens will work, but you would have at least 2 screens (maybe up to four - TRUE, FALSE, TRUE AND FALSE, TRUE AND FALSE AND NULL?) for every boolean column, which could be quite a few screens!
ScottStonehouse
I created a computed field in an entity hoping to fill it with a searchable value that could relate to the bool true/false. For example, (bool) 'IsSmoker' computes into the string as 'Smoker' in its computed field. It failed - computed fields are not searchable. The 'Is Searchable' option disappears when 'Is Computed' is checked. The searching may be done within the database. Will have to see what the next release brings.
Rusty
+1  A: 

Did you try using a Query with a parameter?

Bind that parameter to a boolean property on your screen. Then add the boolean property as a check box on your field layout.

(I am assuming here that searches run against a query)

Schneider