StrataFrame Forum

Browse Dialog - Filter options

http://forum.strataframe.net/Topic12818.aspx

By Tim Dol - 11/23/2007

In our CRM package we can assign sales reps to sales managers. When a sales manager looks at a job listing or account listing they can only see the records for his/her own sales reps.

I need to build a sales manager browse dialog and need to hide the sales rep field, which I can do, but I need to supply a filter behind the scenes such as SalesRep = 'A' or 'B' or 'C' etc.. 

Can I do something like this in the current version?  If not, do you plan on adding this sometime soon?

Thanks,

Tim

By Edhy Rijo - 11/23/2007

Hi Tim,

That is a feature I also requested previously, see my posts at: http://forum.strataframe.net/Topic12011-7-1.aspx

So far, there is no way to filter a combo based on data selected in another object in the Browser Dialog. 

I hope they can add this feature soon!!!

By Ivan George Borges - 11/23/2007

Hi guys.

It is just a thought... what if 2 Browse Dialogs where dropped on the form? The first one could search the parent, and then the second one could have the parent PK set with the current parent value, and not visible.

Would this be a workaround for the time being? Or just a lot of nonsense? Blush

By Edhy Rijo - 11/27/2007

Ivan George Borges (11/24/2007)
Would this be a workaround for the time being? Or just a lot of nonsense? Blush

Hi Ivan,

It is not a nonsense, but it would be very ugly and not user friendly to the end user.  In my case the DB has several fields to do the search, and only 2 of those are related or depend on each other, but the user can select any of the other fields, and I don't see how one would separate those fields and add a 2nd dialog to handle the situation.

By Greg McGuffey - 11/27/2007

I would have sworn they added the ability to use a hidden field in a search with the last release.
By Trent L. Taylor - 11/28/2007

I think there are a number of different assumptions going on within this post.  First, you CAN search on a hidden field.  So it is entirely possible to add a field to the browse dialog that is never presented to the end-user in which you provide a value programmatically.  You would just set visibility of the search field to False within code or the designer:

MyBrowse.SearchFields(0).Visible = False
MyBrowse.SearchFields(0).InitialSearchValue = "MyFilterValue"

Now, as for repopulating a combo within the BrowseDialog once it has been loaded off of the value of another combo-box, this cannot be done at the moment.

By Tim Dol - 11/29/2007

How can I filter multiple values for a single field?

Say I am browsing the customer database and on the browse I have a hidden search field called 'SalesRep'. My database contains 10 records for SalesRep 'A', 5 records for SalesRep 'B' and 3 Records for SalesRep 'C'.  The current user is only allowed to view customer records for SalesRep 'A' or SalesRep 'B'.  I cannot show any customer records that belong to SalesRep 'C'.

Can my search return all records for SalesRep 'A' and 'B' ?  How would you set 'MyFilterValue' to produce this result?. Can I use the same filter logic as I would in the business object filter....  SalesRep = 'A' or SalesRep = 'B'

Thanks

Tim

By StrataFrame Team - 12/3/2007

Trent may correct me if I'm wrong, but I don't think that's currently possible with the BrowseDialog.  All search field values are AND'ed together, and anything you type in has to be able to be placed within a sql parameter.  So, if you wanted to include a field twice, that's fine, but it would have to be something like date < max AND date > min where 'date' is the same field.  So, if you want to have several values OR'ed together, such as in your example where you want to allow one or more of several explicit values, it's not possible at the moment.
By StrataFrame Team - 12/3/2007

Wait a second, I just remembered that we added the Searching event to the BrowseDialog.  In the event args of the event, we pass over the raw WhereStatement collection for the query to be executed.  You still cannot choose to have the values OR'ed together, but in this case, you could use the IN statemet type, so the value would be produced like:

SalesRep IN ('A', 'B')

which would accomplish the same thing for you.  So, you would just have to add a new WhereStatement to the collection with a type of WhereStatementTypeOptions.In and the Values ArrayList containing the "A" and "B."