December 7, 200421 yr Newbies I have two tables in a one-to-many relationship. I'm showing the "one" in a layout with a portal for the "many". The "many" table is already populated. I don't want to add records in that table. I just want to select one of the already-existing records to relate to the "one" record I'm currently viewing. I'm hoping someone here can give me a clue as to what approach to take. I'm not making any progress with my experiments so far.
December 7, 200421 yr Create a global field and a relationship from this global to the serial field in your second table. Put a button in the portal attached to a Set Field [thistable::global; relatedtable::serial]. Now you can use the recently created relationship to reference the selected related record.
December 7, 200421 yr Each record in the "many" table must have a field (remote key) that stores data that uniquely identifies one record in the "one" table. It sounds like you are doing some data migration: you're going to have to more-or-less match them up by hand if necessary, but hopefully the record will alredy have some such unique identifier. The best way to create related records is to allow the relationship to create related records, then just type data into the blank row on the bottom of the portal. FMP will automatically insert the appropriate remote key data into the related records for you.
December 7, 200421 yr Author Newbies Each record in the "many" table must have a field (remote key) that stores data that uniquely identifies one record in the "one" table. I already have that. I'm sorry if I left out that detail. The best way to create related records is to allow the relationship to create related records, then just type data into the blank row on the bottom of the portal. FMP will automatically insert the appropriate remote key data into the related records for you. Aha! That made me flash on what my problem really is: I need to create the records in the "many" table before I know which record in the "one" table they will eventually relate to. That's not the normal order of things so I don't get to use the normal tools. Thanks. I think that should help me figure this out.
December 7, 200421 yr Good call, Vaughan. I read it to mean there were already related records, but one was to be selected specifically, to show more information from that particular record. I would never have interpreted it to mean they weren't already related and the desire was to relate them.
Create an account or sign in to comment