Using the Seaching Browse Dialog event to filter by sub query


Author
Message
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Hello all, 

I am wondering if anyone can submit an example of using the BrowseDialogSearchingEventArgs.Tokens to add the results of a subquery. 

The situation that I would like to handle is: the user is on an Orders screen and they want to search for an order with a particular Product in it. If I used a view for the Browse Dialog that joined Orders and OrderItems I would get multiple rows if I just searched by the Order ID. Since I only want to show a list of orders, I figure the solution would be to use a sub-query (SELECT OrderId FROM OrderItems WHERE OrderItems.item_id = ?). 

From some other threads here and the description of the Tokens property, this should be possible. But I do not know where to start, so I was hoping someone could provide a simple example of using Tokens to inject the sub-query results into the Browse Dialog Search results processing. 

Thank You, 
Govinda 
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Govinda.

Maybe you could have 2 BrowseDialogs in your form. One for the Orders, and this could have Order Number, Client, Date, etc., as SearchFields and would search on the Orders table, and the other BD could have the OrderItems SearchFields including the Product and would search the OrderItems table.
For this second one, you could add a BrowseDialogClosed event handle and use the populated OrderItems BO to get the Orders primary key that returned with it. After that, you just populate your Order BO and the user will have it on the form.

Hope it helps.
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