Jump to content

Checkbox list and many-to-many relationships


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

Recommended Posts

  • Newbies

Alright I have a many-to-many relationship between two tables, tblOrganization and tblTypeOfOrg...I have followed the help file on creating a look-up table between them which i called tblTypeToOrg. tblOrganization has an OrgId as PK and tblTypeOfOrg has a TypeId as PK. TypeToOrg has both OrgId and TypeId and i have set up all the relations between the tables accordingly. In the layout for my Organization i have a check box list pulling its list from the tblTypeOfOrg table. I am storing this in the tblOrganization::tblTypeToOrg typeId field. The problem is when multiple check boxes are selected instead of creating a new record for each marked box, filemaker is simple concatenating the id's together in one id in one record and this doesn't do me any good. If there is any confusion with this or you need more info just let me know. Thanks for the help

Link to comment
Share on other sites

Usually, when working with a many-to-many relationship, I'll use a portal to edit the join table that exists between them. If the checkbox interface is important to you, you can use it, but I think you'll have to attach scripts to each of the checkboxes that will create and delete join table records as boxes are checked and unchecked.

I'm assuming that you set up the relationship from the organization table to the join table so that records in the join table are created automatically when needed, so the first time you check the box, it creates a record. However, the next time you check the box, a record isn't created because a valid record already exists. Key fields work off of the index of a field, and the index separates items based on carriage returns. A checkbox will separate each item with a carriage return, which is why the relationship is valid and won't create a new record when subsequent items in the checkbox are checked.

Create a portal from organization to the join table based on the relationship between them. Allow the creation of related records. In the portal, place the join table's field for the org type and perhaps use a popup list to select which type to make this join record. This will allow you to create the related records with each org type.


Link to comment
Share on other sites

This topic is 7098 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.