tkemmere

Managing triangular relationships

Discussion created by tkemmere on Feb 2, 2016
Latest reply on Feb 2, 2016 by tkemmere

I was going to ask a question cause I was stuck. But in the end I managed myself. So this is just to share the dev-process with whome ever is interested.

 

I have this database with Contracts. Many Pictures can belong to Contracts. Also many Elongations can belong to Contracts. And these Elongations can also have some pictures of their own.

 

So I set it up like this:

  • Table with Contracts. With an ID
  • Table with Elongations. With an ID
  • Table with Pictures. With an ID and a ContractFID and a ElongationFID

 

It looks like this. (Imagine these are layouts with portals in them).

Contracts and thier Pictures I had already going. So far so good. But then I tried to drag the third relationship from Pictures::ElongationFID to Elongations::ID and FM reported No can do. And it suggested to drag to same field in a second TO of Elongations instread. I did that.

 

But the trouble was, that when I'm in the Elongations layout and I added a new related picture, it wouldn't relate.

 

But then I noticed that in the Picture layout, if I pull in a field from Elongations 2nd TO, it would show. So then I was beginning to get the idea.

 

Then I deceided to not have 2 elongations TOs, but rather 2 Pictures TOs. Now I have this and it works.

I guess this is just one of those basic-relational-DB lessons.

 

My next challenge is to make buttons/scripts that allow the user to "move" a picture from and Elongation to a particular contract, but that's doable cause they all have their ID's and it's a matter of emptying and filling the right Forreign IDs.

Outcomes