Jump to content
Server Maintenance This Week. ×

Setting a relationship by name but keying it by ID


This topic is 4657 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Sorry if this was already covered but I already tried searching for this for hours, I swear. And, as you'll soon see, I'm new to FM relationships.

Say I have two tables, each with two fields:

Doctors: doctorid, doctorname

Patients: patientid, patientname

It's a many-to-many relationship so I have a join table:

DoctorPatient: doctorid, patientid

I set it up to create records on the join table from either of the other two tables.

Is there a way for the user to add a patientdoctor relationship by choosing a name from the drop-down list and it adds the correct IDs to the join list? I was able to figure out a solution with script triggers but I want to make sure FMP9 users are able to use it too.

jointables.zip

Link to comment
Share on other sites

Here's a link to a popup selector demo technique that I use for populating join tables when a simple popup menu would be too long and cumbersome. However, you could simply use a popup menu. On the Doctor form, create a portal to the join table. In the portal row, format the _kF_PatientID field to be a popup menu using a value list that consists of PatientID and PatientFullName. Only show the second value.

Likewise, on the Patient Form, create a portal to the join table. Format the _kF_DoctorID to be a popup menu with a value list that consists of DoctorID and DoctorFullName.

Link to comment
Share on other sites

  • Newbies

On the Doctor form, create a portal to the join table. In the portal row, format the _kF_PatientID field to be a popup menu using a value list that consists of PatientID and PatientFullName. Only show the second value.

Likewise, on the Patient Form, create a portal to the join table. Format the _kF_DoctorID to be a popup menu with a value list that consists of DoctorID and DoctorFullName.

This is exactly what I'm looking for. Thank you so much. I had no idea that feature existed.

This is supported on FMP9 and above?

Link to comment
Share on other sites

The script trigger find is FM11 only (isn't that the script trigger release version?). However, you could simply add a button to perform the find in place of the trigger.

Link to comment
Share on other sites

This topic is 4657 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.