StrataFrame Forum

Problem Setting ParentRelationships

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

By choyt - 10/17/2007

Hi Folks

I have 2 tables (a parent and it's details tables). When I am in the BO for the details table, the ParentRelationship is set to (Not Defined) and the ParentObject is set to (None).

When I try to select the ParentRelationship, the "Child-Parent Relationship Editor" is displayed; however, the drop list is both empty and locked. When I click OK, nothing happens and when I click either "Add new Field Pair" or "Cancel" the dialog simply closes.

If I am doing something wrong, please let me know. If not, and if this is a bug, can you forward me the syntax to do this manually?

Thanks!

Clay

By choyt - 10/17/2007

I lied...when I click "OK", I get an error message saying "One or more relationship field pairs...."
By choyt - 10/17/2007

Hi Folks

I manually entered this...

MicroFour.StrataFrame.Business.BusinessParentRelationship businessParentRelationship1 = new MicroFour.StrataFrame.Business.BusinessParentRelationship();
businessParentRelationship1.ForeignKeyField = new string[] { "FK_ID" };
businessParentRelationship1.ParentBusinessObjectType = "BO.APP_NAME";
businessParentRelationship1.ParentPrimaryKeyField = new string[] { "PK_ID" };


Unfortunatly, the information does not appear in the properties window and the parent relationship dialog still doesn't work.

I tried this on several other objects within my solution and none of them work; however, when I open your ChildDialogFormCSharpSample it works fine there.

By choyt - 10/17/2007

I was finally able to set the ParentRelationship after I rebuilt the object 3 times (not sure why the first 2 didn't work but I'm happy!). Now I cannot set the ParentBusinessObject (see attached error). When I look at several other posts on here, it looks like I should be able to do this in the proprties window and I thought I could do it at some point in the past.

Thanks!

By Greg McGuffey - 10/17/2007

This error indicates that you can't set the ParentBusinessObject when you are dealing with the definition of the business object itself. I.e. if you have a business object named CustomersBO, and you double click it in VS solution explorer, the designer opens, were you can hit F4 and view the properties. You can't set the ParentBusinessObject here.



The ParentBusinessObject must be an instance of the parent business object set in the ParentRelationship. So you set this when you create an instance of the parent business object. E.g. you have a form that you drop both the parent and this BO on, then you can set the ParentBusinessObject.



Hope that helps!
By choyt - 10/17/2007

Thanks Greg...yep..that answers it.
By Greg McGuffey - 10/18/2007

Glad that helped!