![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||||||||||||||
| |||||||||||||||
|
|
Instead of using lookups in the interface file, you could use a calculated result, which will update, for instance, if the name is changed in Contacts. |
|
This thread already has some good (great) responses, |
|
but here's how I would describe it, in case a different explanation might help. 1)Contacts has a one-to-many relationship to Link, by Contact ID. 2)Conferences has a one-to-many relationship to Link, by Conference ID. 3)Link has a relationship back to both Contacts and Conferences, from which you can show calculated results of attributes of each (i.e. a calculated Conference Name, First Name, Last Name, etc.) |
|
Using these, you can: 1)Show a portal from Contacts and/or Conferences to Link, so that attributes of the related Conferences are visible from Contacts, and vice-versa. |
|
2)Create two-step navigation scripts from Contacts to Conferences and back for a particular related Contact or Conference, as a "drill-down" button - (i.e. from Conferences, Go to related in Link, then perform a script in Link that goes to relate Contacts.) |
|
3)Create navigation from a Contact to all related Conferences - Create a value list that shows all the Conference ID's from the related Link records. To navigate, use the valuelistitems function to set all those keys into a text field (as a compound key), then go to related Conferences directly where the compound key equals the Conference ID in Conferences. |
|
3)Create navigation from a Contact to all related Conferences - Create a value list |
|
that shows all the Conference ID's from the related Link records. |
|
To navigate, use the valuelistitems function |
|
to set all those keys into a text field (as a compound key), |
|
then go to related Conferences directly where the compound key equals the Conference ID in Conferences. |
A little
|
-----Slightly different topic For many-to-many relationships where the relationship itself has no attributes, I've been making more and more use of compound keys. In the example given, I would have a "choose" script where the user can choose or add Conferences to Contacts, f'rinstance. |
|
As they are added or chosen, the compound Conference key in Contacts is updated. The relationship is then direct, where the compound Conference key matches the Conference ID in Conferences. It's a little trickier to do the same from the Contacts file, since the compound is on the other side of the relationship, but since the adding and choosing is all within a script, it's pretty easy to control, and if you get it right once, you can use it wherever you need this type of relationship. |
|
I'm also curious, Zoara, as to whether SQL supports compound keys, or whether this is a fluke in FM. |
|
If you have a text field in one file with multiple values separated by returns, like this 1 2 3 and you relate (join?) that to another file's field that has a single value, will the compound relate to records 1, 2 and 3 in the foreign file? |
#12
| |||
| |||
|
|
Consider doing all of this from the middle. Create reverse relationships from the join file back to both the Conference and Contact databases. Now, to find all attendees for a given conference, just perform a find on the Conference ID in the join file and use the two new relationships to fill in the appropriate details on your layout. Find on Contact ID and go to a different layout to get the list of conferences for a particular contact. |
![]() |
| Thread Tools | |
| Display Modes | |
| |