StrataFrame Forum

BrowseDialog with Custom Fields in BO

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

By Scott Hershberger - 8/21/2007

My latest weird problem involves a Browse Dialog. We have a Customer Table / BO that simply has a name id. I need to allow the user to search on customer name or Customer number (actually in the table/BO). To do this I created a custom fields of customer name that I populate in the BO. This works great under normal circumstances, but when I try to search on this fields, I obviously get a key error since it cannot create a where clause. Does anyone know a way around this?
By Trent L. Taylor - 8/21/2007

Does anyone know a way around this?

Any field that you want to search on MUST exist in the database since a query is dynamically created.  So in this case a custom property will not work.  I am not clear on what you are trying to accomplish.  You might give me some more details.  Thanks. Smile

By Scott Hershberger - 8/21/2007

Let's see if I can clear it up... Here's a simplified example



Customer Customer_Detail

--------- ----------------

CustomerID CustomerName

Customer No CustomerID



I create a CustomerBO. In that BO I create a Custom Field "Customer_Name". I then fill this with a query.



I now need to use the CustomerBO in a Browse Dialog with a search possible on Customer No and Customer Name.



I'm not sure this can be done. I think I will try a view next.
By Trent L. Taylor - 8/21/2007

Using your example, the Customer_Name is a custom property which, I am guessing, concatinates several fields together.  So your browse could not pull from this property since this does not represent an actual field name.

What is the code behind Customer_Name field?  As for a view, this would be another option.

By Scott Hershberger - 8/21/2007

I think that a view is the best option.



Thanks for your help!