browseDialog


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Please, post your sample and I will have a look.
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
In the samples database I deployed the following view:

SELECT     dbo.Customers.cust_pk, dbo.Customers.cust_FirstName, dbo.Customers.cust_LastName, dbo.Customers.cust_City, dbo.Orders.or_ponumber
FROM         dbo.Customers INNER JOIN
                      dbo.Orders ON dbo.Customers.cust_pk = dbo.Orders.or_cust_pk

named it Customer_po

in the Browse dialog example I aded a BO customer_poBO

Set up the BO to be populated from the server

Overrode primary key specification

put Cust_pk

rebuild all

rebuilt application

added BO to the form

changed the browsedialog to look at it and set the search field appropriately

Put the following code in the toolstip cliked

if (this.printToolStripButton.Pressed)

{

}

set a break point

ran the application

In the object viewer for each field in the BO it says This.(whichever field) threw an exception of type'MicroFour.StratFrame.Business.businessLayerException'

Can you duplicate this?

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
You don't. If your ViewBO instance is set as the BrowseDialog's BusinessObjectToPopulate, it will be automaticaly populated by the BrowseDialog control as soon as it fetches the records based on your search criteria.
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
OK so how do I populate the view BO?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Nope, it sounds like you are on the right track. You can fill any search field on the BD and it will fetch all records from the view you gave it as the BO type. Once you give it an OK it will then populate the BO you set as the BO to Populate with the results of your search criteria. The BO to populate should be an instance of the BO dropped onto your form, and it should be the type of the BO Type you set the BrowseDialog to work with. When you Close the BD, and you have an event exposed for that, you can then work with the BO instance populated with the contents brought according to your search criteria. If the BO instance you populated is the form's PrimaryBusinessObject, you don't even need to do anything, as it will be already populated and positioned on the record you chose from the BD before you OKed it.
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
So maybe I am on the wrong track, my thinking was that the BO would be filled with data from the view and then the dialogbrowser would filter that down to just the rows that met the search citeria, am I missing something? If you have multiple search fields but only put search information in one and leave the rest blank will that work?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
I'm sorry Ian, I'm a bit lost now. I thought you were using a BrowseDialog to search a view which had been mapped to a BO. The BO Mapper should use SQL Server for the view source. On the post I made reference to you, there was an example on how to use the BD to fetch records from the View which will populate the ViewBO instance dropped on your form and then you can use its PKs for whatever when the BD is closed. If this isn't the case, please bare with me and put me in the right direction. Wink
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
Correct, I used PK_certificate. Below is the code for the fill of the BO, should it be different when using a view?

public void Fill()

{

string s = "select * from Cert_listing";

FillDataTable(s);

}

Cert_listing is the name of the view on the server.


Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Ian, follow this post, maybe there is something there that might help you:

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

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
From what you are showing, it looks correct. Maybe you could write a small sample using the StrataFrameSample database in the way you are doing there so we could have a look. A small detail that you probably did right, but you said you specified dbo.Certificate.PK_Certificate on the "Override Primary Key Specification" at the BO Mapper, but I guess you put only PK_Certificate there, which should be the proper way, right?
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