StrataFrame Forum

Unable to get Parent Child Relationship to work.

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

By Michael Reese - 5/30/2008

I cannot seem to get the relationship to work properly on add. When I add a record, the record does not receive the parent key value from the parent bo? 

I think that I have covered everything

I have two tables

Parent Table

Child Table

I established the relationship in the DDT

Established to parentrelationship on the BO

Established the parent BO in the BO on the form.

Configured Childform.

By Ivan George Borges - 5/30/2008

Hi Michael.

Just checking, but you have set the  Primary and Foreign keys on the Child-Parent Relationship Editor of your Child BO, right?

 

Also, have you set the ChildBO ParentBusinessObject property on your Child form?

By Michael Reese - 5/30/2008

Yep
By Ivan George Borges - 5/30/2008

I guess this is a case for Super Man then. He will soon be around. Hehe
By Michael Reese - 5/30/2008

Yeah I dont get it??

Here is my setup

BO

DDT

By Ivan George Borges - 5/30/2008

And on your parent form, for your ChildBO, you have set the ParentBusinessObject property?

By Michael Reese - 5/30/2008

Yes,

Now, is the relationship code executing based off of the parentbo editing state? I have a listview on the parent form which is the child of a parent form.   

By Greg McGuffey - 5/30/2008

Did you include the instance of the child BO that is dropped on the form in the Form's add? I.e. set the appropriate IncludeInForm(Add/Delete/Edit/Save/Undo/Navigate) properties?
By Trent L. Taylor - 5/30/2008

Yeah, you are missing something really basic as this is not a complicated implementation....instead of going through a hundred forum posts out here, do one of two things, or both.

  1. Open one of the SF samples that shows how to use a relationship (CRM sample application, ChildFormDialog sample, etc).
  2. Post a quick sample of your basic implementation on this thread and I will correct your problem (within the basic sample...not your application code) so you can see what you are missing....this is faster than going back and forth.
By Michael Reese - 5/31/2008

Ok, Got it.

In a nutshell, my applications has 3 forms and my parent relationship call was not at the highest form.

This is what I had.

Mainform

Contains a datagridview with a mainBO. From the Mainform, I have a childdialog calling the sub Entryform with the mainBO.

Entryform

This form contains the mainBO and childbo.

I had the parentchild relationship established in the Entryform.

ChildEntryform

Contains the childbo

When I moved the childbo up to the Mainform and established the relationship there, all the relationships worked.

Michael

By Trent L. Taylor - 6/1/2008

Glad you found it Smile