Is it possible to add a filter condition to what gets displayed in the BrowseDialog?


Is it possible to add a filter condition to what gets displayed in the...
Author
Message
Marcia G Akins
Marcia G Akins
StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

I am working on an application where there is an application level filter in effect by user. I would like to use the BrowseDialog to allow the users to search for records but only within a subset that satisfies the filter condition.

Is it possible to do this?

TIA

Marcia
Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Marcia,
Yes, you can do all that.  Take a look at the Browse Dialog topic in the UI Layer in the help file.  There is a "Visible" property that will allow you to show/hide any search field, also you can set a default value programatically without user know about it.

Edhy Rijo

Marcia G Akins
Marcia G Akins
StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi Edhy.

Thanks for the quick response. I have done what you suggested before for simple filter conditions. However, this one is a bit more complex. It would be something like this:

ProviderID IN (2, 4, 6, 8, 10)

Can I do something like that with an invisible field?

TIA

Marcia
Aaron Young
Aaron Young
StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi,

I wonder if your intention is to filter the results of the search query? If so, you can add a where clause in the BrowseDialog_Searching event. The following example adds a where condition that only returns records which have two fields equal to 0:-

// Add a "Where" clause to only include records where FIELD1 = 0 and FIELD2 = 0

System.Collections.ArrayList value = new System.Collections.ArrayList();

value.Add(0);

MicroFour.StrataFrame.Data.
WhereStatement where1 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "FIELD1" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.Equals);

e.RawWhereStatementsCollection.Add(where1);

MicroFour.StrataFrame.Data.
WhereStatement where2 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "FIELD2" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.Equals);

e.RawWhereStatementsCollection.Add(where2);

Hope this helps.


Aaron Young
Aaron Young
StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Oops, I crossed posts with you.

There is an "IN" clause, i.e. "MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In"
Marcia G Akins
Marcia G Akins
StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Aaron Young (3/14/2011)
Hi,

I wonder if your intention is to filter the results of the search query? If so, you can add a where clause in the BrowseDialog_Searching event. The following example adds a where condition that only returns records which have two fields equal to 0:-



This is exactly what I want to do! Thanks a million before taxes!

Marcia
Aaron Young
Aaron Young
StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Please don't mention taxes.....
Marcia G Akins
Marcia G Akins
StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi Aaron.

Here is the code that I have in brwPatients_searching method and it does not filter the what is returned - it gives me all the records.

What am I doing that is stupid?

// Add a "Where" clause to only include records where the provider id

// is in the current filter condition

System.Collections.ArrayList value = new System.Collections.ArrayList();

value.Add(
AppMain.Current_Filter);

MicroFour.StrataFrame.Data.
WhereStatement WhereClause = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ProvID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);


Marcia G Akins
Marcia G Akins
StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)StrataFrame User (492 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi Aaron.

Never mind. I must have taken my stupid pills this morning. Blush I was missing this line of code:

e.RawWhereStatementsCollection.Add(where2);
Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Please don't mention taxes.....


Smile  Amen!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search