Jump to content
Server Maintenance This Week. ×

Transferring parent key to child file


peleve

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

Recommended Posts

  • Newbies

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Newbies

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.

Link to comment
Share on other sites

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