StrataFrame Forum

BO to Child relationships

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

By Derrick Bell - 11/20/2006

I have an interesting problem. I have two childBOs that will always have exactly one instance and expect them to be added along with the parent information in the form. Your examples show instances where one of more children exist, nice separate event allow the insertion of children. To be sure I have need of there as well, but first how would you recommend I proceed with the 1-to1 children?
By StrataFrame Team - 11/20/2006

I'm having a problem trying to understand your question... perhaps you could rephrase it or expand on it a bit?

As for configuring a 1-to-1 relationship... you would do this the exact same way as you would with a standard child... configure the relationship and then specify the instance of the parent that is the parent business object of the child.

By Derrick Bell - 11/20/2006

Hmmm.. I'll try again under a different tack. I added a linked child BO object by using Child-parent Relationship editor and setting th primary keys. I then added the childBO to my maintenance form and updated its parent business object property. The form now skips the single field I've bound to the childBO. Cn you please advise?
By Trent L. Taylor - 11/20/2006

The form now skips the single field I've bound to the childBO. Cn you please advise?

Is there any data in the child BO?  WHen you say "skips the field" what do you mean?  When you create a new parent record you still have to call the Add() method on the child or populate it with data before any fields can be updated with the child BOs data.  Does that make sense?

By Derrick Bell - 11/20/2006

Hmm yes it does. How do I call the add if the data in inline with the rest of my parent data?
By Derrick Bell - 11/20/2006

And no there is no data in the child yet.
By Trent L. Taylor - 11/20/2006

You can either capture the AfterAddNew event of the parent record and add a new child record:

MyChild.Add()

Or you can use the IncludeInForm... settings on the form and the business object.  Read the help topic in the StrataFrame Help: Business Layer -> Configuring a Business Object -> Form Include Settings

By Derrick Bell - 11/20/2006

I had in the mean time turned on the form include options(I turned them all on) , but the the textbox that is bound to the column of the child BO still doesnt activate.
By StrataFrame Team - 11/20/2006

What is the EditingState of the child business object after you call Add()?
By Trent L. Taylor - 11/20/2006

Derrick,

This is a side note, but would it be possible for you to make it out here for the December training class?  I think it would dramatically speed your decision making and development process up.