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
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 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
Replies
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 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
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Please don't mention taxes.....
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 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
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 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 (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Please don't mention taxes.....


Smile  Amen!

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
One other thought on this would be to create a View.  The Browse dialog has the ability to change the query table.  This include the support of a view.  You can also change this at run-time allowing you to have multiple views if necessary.  Just another thought Smile
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (3/15/2011)
One other thought on this would be to create a View.  The Browse dialog has the ability to change the query table.  This include the support of a view.  You can also change this at run-time allowing you to have multiple views if necessary.  Just another thought Smile


Can you share some sample code with me? I do not think that the multiple views would work because the user can select one or more providers so the data that the browse dialog runs over would have to change with a dynamic WHERE clause at run time.

TIA

Marcia
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Probably this thread can help you out: http://forum.strataframe.net/FindPost23458.aspx

Edhy Rijo

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
[quote]Edhy Rijo (3/15/2011)
Probably this thread can help you out: http://forum.strataframe.net/FindPost23458.aspx[/quote]

Hi Edhy.

Thanks for trying to help. I don't think that this is going to do what I want. What I really need is for the code that Aaron gave me to put in the BrowseDialog_searching method to work as advertised. I followed his instructions exactly, but the result set was not filtered by the current provider(s).
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Marcia G Akins (3/15/2011)
...What I really need is for the code that Aaron gave me to put in the BrowseDialog_searching method to work as advertised. I followed his instructions exactly, but the result set was not filtered by the current provider(s).

I see.  Sorry, I have not used that functionality of the Dialog Browser yet.

Edhy Rijo

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

Sorry for the late reply. Is this still your code?

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);

Assuming you are still using the code above, I think AppMain.Current_Filter is the problem. I suspect it is a list of provider ID numbers but they are being added to the value array as a single element. They should be split and added as individual array elements. For example, take a look at this code:-

// This code adds a WHERE clause of "ID IN (10000145, 10000146, 10000149)
System.Collections.ArrayList value = new System.Collections.ArrayList();
value.Add(10000145);
value.Add(10000146);
value.Add(10000149);
MicroFour.StrataFrame.Data.
WhereStatement where1 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);
e.RawWhereStatementsCollection.Add(where1);

The above code definitely 100% works so if you can split AppMain.Current_Filter into separate IDs and add them to the array then you could be in luck. If it still doesn't work, can you give me an example for AppMain.Current_Filter?

Aaron

Edited 14 Years Ago by Aaron Young
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Aaron Young (3/15/2011)
Hi Marcia,

Sorry for the late reply. Is this still your code?

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);

Assuming you are still using the code above, I think AppMain.Current_Filter is the problem. I suspect it is a list of provider ID numbers but they are being added to the value array as a single element. They should be split and added as individual array elements. For example, take a look at this code:-

// This code adds a WHERE clause of "ID IN (10000145, 10000146, 10000149)
System.Collections.ArrayList value = new System.Collections.ArrayList();
value.Add(10000145);
value.Add(10000146);
value.Add(10000149);
MicroFour.StrataFrame.Data.
WhereStatement where1 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);
e.RawWhereStatementsCollection.Add(where1);

Aaron


Hi Aaron. Thanks so much for all the help you have given me. Everything is working now. The problem was not Current_Filter. I am embarrassed to say that it was the loose nut behind the keyboard Blush
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
This code is not filtering the result set. Here is what I am trying to do. I am searching for patients but I only want the browse dialog to search patients for one or more specific providers that have been set as an application level filter.

Even with the code in the Searching method, I am still getting all the patients back.

What am I doing wrong?
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
This code is still not working to filter the result set. This is what I am trying to do. I have an application level filter set up to displat information from one or more selected providers. When I go to select a patient, I want the result set to include only patients for the provider(s) that have been set up as the application level filter.

When I search, all patient records are being returned.

What am I doing wrong?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Marcia G Akins - 14 Years Ago
Edhy Rijo - 14 Years Ago
Marcia G Akins - 14 Years Ago
Aaron Young - 14 Years Ago
Aaron Young - 14 Years Ago
Marcia G Akins - 14 Years Ago
                     Please don't mention taxes.....
Aaron Young - 14 Years Ago
                         Hi Aaron. Here is the code that I have in brwPatients_searching...
Marcia G Akins - 14 Years Ago
                         Hi Aaron. Never mind. I must have taken my stupid pills this morning....
Marcia G Akins - 14 Years Ago
                             [quote] Please don't mention taxes..... [/quote] :) Amen!
Trent L. Taylor - 14 Years Ago
                                 One other thought on this would be to create a View. The Browse dialog...
Trent L. Taylor - 14 Years Ago
                                     [quote][b]Trent L. Taylor (3/15/2011)[/b][hr]One other thought on this...
Marcia G Akins - 14 Years Ago
                                         Probably this thread can help you out:...
Edhy Rijo - 14 Years Ago
                                             [quote][b]Edhy Rijo (3/15/2011)[/b][hr]Probably this thread can help...
Marcia G Akins - 14 Years Ago
                                                 [quote][b]Marcia G Akins (3/15/2011)[/b][hr]...What I really need is...
Edhy Rijo - 14 Years Ago
                                                     Hi Marcia, Sorry for the late reply. Is this still your code?...
Aaron Young - 14 Years Ago
                                                         [quote][b]Aaron Young (3/15/2011)[/b][hr]Hi Marcia, Sorry for the...
Marcia G Akins - 14 Years Ago
                                 This code is not filtering the result set. Here is what I am trying to...
Marcia G Akins - 14 Years Ago
                                 This code is still not working to filter the result set. This is what...
Marcia G Akins - 14 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search