Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Transferring parent key to child file


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

Recommended Posts

  • Newbies
Posted

I have been a longtime, but only an occasional, user of FileMaker who has been asked to look into the development of two applications. As a result I have been immersed in the design and prototyping process for the last three weeks. I am stumped at finding a particular interface solution that I hope someone can help me with.

What I want to do is to create on a layout in a child file a list of a select set of fields of ALL parent records. Then I would like to highlight or click on a parent and transfer the parents primary key to the child's secondary key field.

It would appear that situation must have been discussed before, but I can't find a discussion on it anywhere.

Thanks ahead of time.

Posted

First, you need to create a relationship from the child file to the parent file using a key that will display all of the parent records. To create sucn a relationship create a calculated field in both files:

One (calculation, number, indexed) = 1

Create a relationship from the child file to the parent file (AllRecords) based upon the matching these two fields.

Next display the realated records from the parent file on a layout in the child file using a portal with this relationship. You can set the secondary key by using a script with a set field:

Set Field(Secondary Key, AllRecords::Secondary Key)

attached to a button in the (or a transparent button covering) the portal row.

-bd

  • Newbies
Posted

Thanks for the tip. I had figured out something similar; a calc=1field in both files, a realation ship with the two calc1s, and a portal with the name and a button. My script, however, copied the secondary key to the clip board using a script in the related file, and pasted the result with a script in the primary file. Double cliccking the button would transfer the key. I'll try out your script also.

Posted

When possible, avoid the use of the clipboard (copy and paste). Set Field does not require that fields be visible on the layout and can't be interferred with by other application that use the clipboard.

-bd

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