Working with Browsedialog with view


Author
Message
Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi Trent,



I found this link at: http://forum.strataframe.net/Topic23458-7-1.aspx?Highlight=browsedialog+with+view



I tried to implement it and so far it does not work for me.Wink



Reading the below I was not sure where do I add the fields that do not exits in the mainBO.

I will also add the search fields even though they do not exist as part of the original table structure:




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.



The View name is: Get_Products_MenuOptions_View and main table for that form is: ProductsMGR



I appreciate some clarifications in that matter.



Thanks,



Doron

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.
Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi Trent,



I download the sample app found at: http://forum.strataframe.net/Topic24160-6-1.aspx#bm24293 for the browse dialog and it is works fine on my computer. But in my scenario I can not make it to work.



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.



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.



This the main bo is named: ProductsMGRBO and it has the below fields:

ProductsMGR_PK

SearchOptions_FK

SearchCategories_FK

Products_FK

DisplayProdutOrder

DateTimeCreated



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.Smile



The below view is based on a SP that I used all the time with no problem.

Here is the corrected view:



CREATE VIEW [dbo].[Get_Products_MenuOptions_View]

AS

SELECT

dbo.ProductsMGR.ProductsMGR_PK,

dbo.ProductsMGR.SearchOptions_FK,

dbo.ProductsMGR.SearchCategories_FK,

dbo.ProductsMGR.Products_FK,

dbo.ProductsMGR.DisplayProdutOrder,

dbo.ProductsMGR.DateTimeCreated,

dbo.Products.ProductName,

dbo.Products.Price,

dbo.Products.OriginalPrice,

dbo.Products.DiscountedPrice,

dbo.SearchCategories.SearchCategory,

dbo.SearchOptions.SearchOption,

dbo.Products.ProductNo,

COALESCE(dbo.Products.Percentage,'UNKNOWN') AS Percentage

FROM

dbo.ProductsMGR

INNER JOIN dbo.Products

ON dbo.ProductsMGR.Products_FK = dbo.Products.Products_PK

INNER JOIN dbo.SearchOptions

ON dbo.ProductsMGR.SearchOptions_FK = dbo.SearchOptions.SearchOptions_PK

INNER JOIN dbo.SearchCategories

ON dbo.ProductsMGR.SearchCategories_FK = dbo.SearchCategories.SearchCategories_PK

GO





Thanks,



Doron
Attachments
menu_options3.xls (182 views, 21.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Thiw is somewhat hard to diagnose without actually having your data anb the environment setup.

On a small scale, outside of your application, can you make this work?  If you create a test project to setup this one thing, can you get it to work?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search