Relationship Management


Author
Message
Daniel Volz
Daniel Volz
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 11
Hello,

I try out Strataframe at the Moment and have an question. I want to create the following example:

Customers 1:n Orders

Orders 1:n OrderPositions

Articles 1:n OrderPositions

So i have to create two Relations in die OrderPositionsBO, but the wizard can only manage one Relation per BO, how can I write more than one Relationships in the same BO?

I have a SQL Server 05 and don't use die Database Employment Toolkit from Stratarframe.

best regards,

Daniel

Reply
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
There are several things you can do in regards to relationships.  In this case though, I do not think that you need to necessarily have a relationship between the two, but rather a Fill method that populates based off of the articles or the orders.  The parentRelationship property is for defining the foreign key parent that will be managed automatically by the framework when adding new records or populating strictly by the parent. 

In your case, you just have to foreign keys that will be populated differently based on whether you are wanting to use the articles or the orders.  Create two Fill methods in the business object and call whichever you need when  populating:

Public Sub FillByArticles(ByVal ArticlePrimaryKey As Integer)
   Me.FillDataTable("SELECT using the articles...")
End Sub

Public Sub FillByOrders(ByVal OrderPrimaryKey As Integer)
   Me.FillDataTable("SELECT using the orders...")
End Sub

The normal way for my customers is to click "New" and a empty order appears.

You can do whatever you want here.  Our Orders Entry example is not condusive to what happens in every business situation.  This just comes down to how you decide to program your form.  You can easily call the Add on the orders before you do anything else:

For example:

Orders.Add()

That is all you have to do in order to create your order record first.

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