May 8, 200718 yr Hi, I'm new to filemaker from mysql and am having trouble translating my knowledge. I have two tables (people and emails) in a one to many relationship. I have a primary_email field in the people table to identify which email is their primary one (duh), but can't figure out how to show only this email address in a people-centric layout. In MySQL I would select the entry from email table that has email_ID=primary_email. Is there a way to mimic this in filemaker? Thanks.
May 8, 200718 yr I'm a little unclear on the primary_email field idea. Regardless, to make the relationship I would use the following fields. E-mail table: 1) _kf_idPerson (which would be the id of the person who owns the e-mail address) 2) _k_PrimarySecondary (a field indicating whether the e-mail was primary or not, would have a value of "Primary" or "Secondary", etc.). People table: 1) _kp_idPeople (auto entered serial number that is the person's numeric id) 2) _kg_Primary (a global calculation = "Primary" with a text result) Then your relationship would be _kf_idPeople = _kp_idPeople and _k_PrimarySecondary = _kg_Primary
May 8, 200718 yr Author The primary field idea is to identify which email address is a person's primary address, because we may have 2 or 3 addresses on file for them. I'd like to display only the primary address on a layout summarizing personal info (there's no need to list all the email addresses we have). I understand the relationships needed to associate these two entities, but I don't know how to get filemaker to do what I want -- show the email address on the people layout.
May 8, 200718 yr I would actually do it a slightly different way. E-mail table: _kp_EmailID (auto-serial) _kf_PersonID EmailAddress People table: 1) _kp_PersonID (auto serial) 2) _kf_EmailMain There is obviously two relationships here. One would be from People::_kp_PersonID to Email::_kf_PersonID. This would show all the related email addresses. I would show all of them in a portal. Then I would have a button on the portal that would simply set the _kf_EmailMain to whatever EmailID of the related record would be. Set Field [ People::_kf_EmailMain; RelatedEmails::_kp_EmailID ] (where RelatedEmails is what the name of the Table occurence would be called to display all related emails. You can then have a second relationship from this People::_kf_EmailMain to the _kp_EmailID of a NEW table occurence. Lets call this MainEmail. So the relationship would be keyed on People::_kf_EmailMain to MainEmail::_kp_EmailID Now you can just put the Email field from the related MainEmail TO on the person layout and it will display the primary email.
May 9, 200718 yr Author Ahhh.. Thank You. As I'm new to filemaker I'm also new to 'Table Occurrences'. Adding a new TO to relate emails to people via the primary_email key did the trick. Again, Thank You.
Create an account or sign in to comment