﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Working with Browsedialog with view</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 02:19:11 GMT</lastBuildDate><ttl>20</ttl><item><title>Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24162.aspx</link><description>Hi Trent,&lt;br&gt;
&lt;br&gt;
I found this link at: [url]http://forum.strataframe.net/Topic23458-7-1.aspx?Highlight=browsedialog+with+view [/url]&lt;br&gt;
&lt;br&gt;
I tried to implement it and so far it does not work for me.;)&lt;br&gt;
&lt;br&gt;
Reading the below I was not sure where do I add the fields that do not exits in the mainBO.&lt;br&gt;
[quote]I will also add the search fields even though they do not exist as part of the original table structure:[/quote]&lt;br&gt;
&lt;br&gt;
Like in my BO I have 2 FKs like: SearchOptions_FK and SearchCategories_FK and need to add the actual description fields for those FKs some where. Also the Result I have some more FKs that is needed to be shown as well.&lt;br&gt;
&lt;br&gt;
The View name is: Get_Products_MenuOptions_View and main table for that form is: ProductsMGR&lt;br&gt;
&lt;br&gt;
I appreciate some clarifications in that matter.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Doron&lt;br&gt;</description><pubDate>Thu, 27 Aug 2009 08:46:56 GMT</pubDate><dc:creator>Doron Farber</dc:creator></item><item><title>RE: Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24327.aspx</link><description>Thiw is somewhat hard to diagnose without actually having your data anb the environment setup.&lt;/P&gt;&lt;P&gt;On a small scale, outside of your application, can you make this work?&amp;nbsp; If you create a test project to setup this one thing, can you get it to work?</description><pubDate>Thu, 27 Aug 2009 08:46:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24314.aspx</link><description>Hi Trent,&lt;br&gt;
&lt;br&gt;
I download the sample app found at: [url]http://forum.strataframe.net/Topic24160-6-1.aspx#bm24293 [/url] for the browse dialog and it is works fine on my computer. But in my scenario I can not make it to work.&lt;br&gt;
&lt;br&gt;
I even tried a to test with a simple form as you did in your sample. When I had the fields name like: SearchOption and SearchCategory I still loose these names when looking into other fields in the combo box for Search Fields or the BrowseResultLayout.  For the  SearchOption and SearchCategory I have actually the FKs in that BO. If I type the names of those 2 fields and running the browse dialog I am getting this error as well: Object reference not set to an instance of an object.&lt;br&gt;
&lt;br&gt;
If I had another field which is part of the BO then the browse dialog is loaded but those 2 fields SearchOption and SearchCategory are not shown.&lt;br&gt;
&lt;br&gt;
This the main bo is named: ProductsMGRBO and it has the below fields:&lt;br&gt;
ProductsMGR_PK&lt;br&gt;
SearchOptions_FK&lt;br&gt;
SearchCategories_FK&lt;br&gt;
Products_FK&lt;br&gt;
DisplayProdutOrder&lt;br&gt;
DateTimeCreated&lt;br&gt;
&lt;br&gt;
Actually me Edhy tried to make it work, but it just did not happen. Is there a view problem in here? See also attached data after running the view. If you look at the attached spread sheet there is no any NULL record. It is a straight forward data.:)&lt;br&gt;
&lt;br&gt;
The below view is based on a SP that I used all the time with no problem.&lt;br&gt;
[u]Here is the corrected view:[/u]&lt;br&gt;
&lt;br&gt;
[codesnippet]CREATE VIEW [dbo].[Get_Products_MenuOptions_View]&lt;br&gt;
AS&lt;br&gt;
SELECT&lt;br&gt;
dbo.ProductsMGR.ProductsMGR_PK, &lt;br&gt;
dbo.ProductsMGR.SearchOptions_FK,&lt;br&gt;
 dbo.ProductsMGR.SearchCategories_FK,&lt;br&gt;
dbo.ProductsMGR.Products_FK, &lt;br&gt;
        dbo.ProductsMGR.DisplayProdutOrder,&lt;br&gt;
dbo.ProductsMGR.DateTimeCreated,&lt;br&gt;
dbo.Products.ProductName,&lt;br&gt;
dbo.Products.Price,&lt;br&gt;
dbo.Products.OriginalPrice, &lt;br&gt;
        dbo.Products.DiscountedPrice,&lt;br&gt;
dbo.SearchCategories.SearchCategory,&lt;br&gt;
dbo.SearchOptions.SearchOption,&lt;br&gt;
dbo.Products.ProductNo, &lt;br&gt;
        COALESCE(dbo.Products.Percentage,'UNKNOWN') AS Percentage&lt;br&gt;
FROM         &lt;br&gt;
dbo.ProductsMGR &lt;br&gt;
INNER JOIN dbo.Products&lt;br&gt;
ON dbo.ProductsMGR.Products_FK = dbo.Products.Products_PK&lt;br&gt;
INNER JOIN dbo.SearchOptions&lt;br&gt;
ON dbo.ProductsMGR.SearchOptions_FK = dbo.SearchOptions.SearchOptions_PK &lt;br&gt;
INNER JOIN dbo.SearchCategories&lt;br&gt;
ON dbo.ProductsMGR.SearchCategories_FK = dbo.SearchCategories.SearchCategories_PK &lt;br&gt;
GO&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Doron</description><pubDate>Wed, 26 Aug 2009 11:31:09 GMT</pubDate><dc:creator>Doron Farber</dc:creator></item><item><title>RE: Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24193.aspx</link><description>Well, the first red flag that I see is that you are using LEFT JOINs and then not COALESCEing anything from those JOINs.  This can produce an error.  If you look at the sample that you referenced that I added, I avoided using the LEFT JOIN and placed all logic within inline SELECTs.  You don't necessarily have to do this, but if you are going to use LEFT JOINs, you MUST take any type of NULL value into account.  That is the first thing that I suggest you address.</description><pubDate>Fri, 14 Aug 2009 10:37:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24181.aspx</link><description>Hi Trent,&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I have done the below already before, and let me explain what I have done.&lt;/P&gt;&lt;P&gt;[quote]Before you get too deep, first, just create a view that returns all of the same columns and attach it and see it the browse still works. If so, then let's go from there.[/quote]&lt;/P&gt;&lt;P&gt;BrowseResultLayout - All fields needed from the ProductsMGRBO (mainBO)&lt;BR&gt;BusinessObjectToPopulate - ProductsMGRBO1 (main biz object)&lt;BR&gt;BusinessObjectTipe - &amp;nbsp; ProductsMGRBO&lt;BR&gt;&lt;BR&gt;OverRideSearchTableName - Get_Products_MenuOptions_View1 &lt;BR&gt;OverRideSearchTableSchema - dbo&lt;/P&gt;&lt;P&gt;SearchFields - Need to place the SearchCategory and&amp;nbsp;SearchOption fields which are part of the view and also in the Result Layout.&lt;BR&gt;&lt;BR&gt;Here is the actual view name: Get_Products_MenuOptions_View&lt;/P&gt;&lt;P&gt;I am trying to&amp;nbsp;search based of these fields:&amp;nbsp;&amp;nbsp;SearchCategory and&amp;nbsp;SearchOption(part of the view)&amp;nbsp;while the FKs of those fields are in the main BO named: ProductsMGRBO. The ProductsMGR is the main BO.&lt;/P&gt;&lt;P&gt;[codesnippet]SELECT &lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.ProductsMGR_PK,&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.SearchOptions_FK,&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.SearchCategories_FK,&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.Products_FK,&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.DisplayProdutOrder,&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR.DateTimeCreated,&lt;BR&gt;&amp;nbsp;dbo.Products.ProductName,&lt;BR&gt;&amp;nbsp;dbo.Products.Price,&lt;BR&gt;&amp;nbsp;dbo.Products.OriginalPrice,&lt;BR&gt;&amp;nbsp;dbo.Products.DiscountedPrice,&lt;BR&gt;&amp;nbsp;dbo.Products.ProductNo,&lt;BR&gt;&amp;nbsp;dbo.SearchCategories.SearchCategory,&lt;BR&gt;&amp;nbsp;dbo.SearchOptions.SearchOption&lt;BR&gt;FROM&lt;BR&gt;&amp;nbsp;dbo.ProductsMGR&lt;BR&gt;&amp;nbsp;LEFT OUTER JOIN dbo.Products ON (dbo.ProductsMGR.Products_FK = dbo.Products.Products_PK)&lt;BR&gt;&amp;nbsp;LEFT OUTER JOIN dbo.SearchOptions ON (dbo.ProductsMGR.SearchOptions_FK = dbo.SearchOptions.SearchOptions_PK)&lt;BR&gt;&amp;nbsp;LEFT OUTER JOIN dbo.SearchCategories ON (dbo.ProductsMGR.SearchCategories_FK = dbo.SearchCategories.SearchCategories_PK)[/codesnippet]&lt;/P&gt;&lt;P&gt;Now how do I add the other fields from the view.&amp;nbsp; Please provide some steps.&lt;BR&gt;&lt;BR&gt;Thanks,&lt;/P&gt;&lt;P&gt;Doron&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&amp;nbsp;</description><pubDate>Thu, 13 Aug 2009 10:06:42 GMT</pubDate><dc:creator>Doron Farber</dc:creator></item><item><title>RE: Working with Browsedialog with view</title><link>http://forum.strataframe.net/FindPost24175.aspx</link><description>Doron,&lt;br&gt;
&lt;br&gt;
Before you get too deep, first, just create a view that returns all of the same columns and attach it and see it the browse still works.  If so, then let's go from there.&lt;br&gt;
&lt;br&gt;
This feature simply allows you to create a query that returns all rows (perform joins etc.) that can be searched on within the view results.  But you will want to make sure that the BO pulling the result set still includes any fields associated with that table that are being referenced.  Try the first step from above and see if you can at least query the exact same results that the BO table pulls.&lt;br&gt;
&lt;br&gt;
For example:&lt;br&gt;
&lt;br&gt;
[codesnippet]SELECT * FROM MyTable[/codesnippet]</description><pubDate>Thu, 13 Aug 2009 08:55:16 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>