New version of Quick Objects is now available! Download V5 today or read further!


Search for...   
Register Login
View Cart  View Cart Checkout  Checkout
Topic Topic:
Another over load for BaseField.IN
Posted On: 2/20/2009 7:01 PM
Posted By: Mike Hamilton


Was wondering what is thought of being able to pass in a business object into a new overload of the basefield.In method.

It would be nice to create the second business object and just set the search fields and thier values on that object and then pass it to the IN method. That would then do find (if no resultset) and use the first column in resultset (if more than one was set to return) to get the values to set for the "in" clause for the first objects field.

will give example of what I am picturing
Note this is not a great example as this could be done with a simple join, but still shows the basics of the steps code would do.
  1. set up the object you want to get list of values from for use in the IN clause
  2. pass that object into the field of the object you want to do an IN search on
        If Me.TextBox_State.Text.Trim <> String.Empty Then 
            Using Orders As New Orders()  
                Using Customers As New Customers  
                    Customers.SetVisibleFields(True, Customers.CustomerID)  
                    Customers.State.Value = Me.TextBox_State.Text  
                    Customers.State.UseInSearch = True 
 
                    Orders.CustomerID.In(Customers)  
 
                    Orders.Find()  
                End Using  
            End Using  
        End If 
 





Replies Posted On / By
  Thanks for the suggestion. Two options are there for implementing this:

1. The In method runs a Find and creates a list of values which is used in the SQL. (as you suggest)
2. The In method indicates to business object that you like to create a subquery to be used with the IN clause.

This feature request is now in our list, and most likely we'll be able to provide both options.

Thanks,
Ish
 
2/23/2009 12:37:07 PM
Ish Singh