Problems with creating Relationship


Author
Message
Ulrik Mueller
Ulrik Mueller
StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)
Group: Forum Members
Posts: 18, Visits: 59
In my current startup project on StrataFrame - i'm trying out with something very simple, but i'm getting stuck on creating a foreign key relationship between two tables.

I keep getting "There is no primary or candidate keys in the referenced table 'customer' that match the referencing column list in the forwign key 'fk_co_zip'"

BO1:  Customer - cu_number (PK), cu_name, cu_zip_number

BO2:  Zipcodes - zip_number (PK), zip_text

I'm trying to make a foreign key between cu_zip and zip_number.

I'm running on MS SQL 2005 Express Edition.

Hope that some of you can come up with the gold answer (i'm sure it is stragiht forward and simple)

Best regards

Ulrik Müller

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
Well, if you are getting this error when you save, then this is not on the SF side.  However, in this case, it would just be a matter of opening the designer for the BO2 class (double click the BO2 class in the Solution Explorer).  There is a property called ParentRelationship.  Use the type editor (click the ellipsis button on that property) and setup the relationship between the two.  Then once you drop on an instance of each of these BOs, you will set the ParentBusinessObject property of BO2 to the instance of BO1.  That's it.  There are many samples on this including the StrataFlix sample.  There is also a lot of documentation on this as well.

If you are getting an error when you save, then there may be something going on data side.  But in regards to setting up a BO relationship, that is all that is necessary.

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