Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using Magic Key To Create And View Related Records

Featured Replies

Hi All :wave:

I came up with something I thought was pretty cool today so I decided I would like to share. I don't imagine it's an original idea or anything but I've not seen it mentioned anywhere. So in hopes that it might be useful to someone here goes...

This is a small twist on a basic and familiar notes solution that allows for creating related notes that are viewed in a portal on the parent layout, with the ability to select a portal row to view the details in fields on the same layout.

I have been experimenting with record creation using the Magic Key technique for those times when I don't wish to leave the layout, as discussed in this thread;

http://fmforums.com/...__fromsearch__1

Today I was building a notes system using the Magic Key technique and I realized that the same TO and relationship that I added for creating the record could also be used to view the notes as well.

That's it. That's the big epiphany. Hope it's worth sharing for someone :geek:

2/28 - 7:18 pm eastern

Edited file to make the magickey field global and set an onRecordLoad script trigger to clear the selection when switching records

2/29 - 10:24 am eastern

Added in the solution for retaining note being viewed record by record discussed below

MagicKeyCreateView.zip

  • Author

Here's a demo that uses the Magic Key technique to create and view records through a join table. The demo is for a task system where more than one person can be assigned to the task.

2/28 - 8:55 pm eastern

Edited file to make the magickey fields global and set an onRecordLoad script trigger to clear the selection when switching records. Also switched the relationships around a bit.

2/29 - 10:09 am eastern

Found a fatal flaw in the relationship setup. Removed the file. Will fix and reupload...

2/29 - 11:23 am eastern

Fixed the fatal flaw. Added ability to retain task being viewed record by record as discussed below

MagicKeyJoinDemo.zip

I'd say that's a compelling argument for using the MagicKey field over some of the other options mentioned in the post you linked to.

One improvement: instead of selecting all the fields and using them as a button, use a text object with a single space (FileMaker delete's text object's with no text), then make sure it covers the entire row. Right now, you can click in-between or above/below fields and the script is not performed.

  • Author

One improvement: instead of selecting all the fields and using them as a button, use a text object with a single space (FileMaker delete's text object's with no text), then make sure it covers the entire row. Right now, you can click in-between or above/below fields and the script is not performed.

I agree. In the working system I have done just that. Just got a little sloppy with the demo :)

I am not quite sure what "Magic Key" is. However, I believe that the selection being stored a non-global field means that one user selects which record will be viewed by all users.

  • Author

Good point. I'll have to think about that :sad:

I had not made it global so it wouldn't keep the same data in the view fields when moving to another record. I supose I could make the fields global and clear them on record load. But then if a user leaves the record and comes back, they would have to reselect the portal row they were viewing...

Hmmmm...

More to think about. Well I am just experimenting. Learning alot too :twitch:

I am not quite sure what "Magic Key" is.

http://www.filemakerhacks.com/?p=2364

I wasn't paying attention when I looked at the file apparently, because I just assumed it was global, since that's what the "Magic Key" method calls for.

I supose I could make the fields global and clear them on record load.

You could use a global field with multiple lines - one for each parent/selected child combination.

See also (for version 11):

http://fmforums.com/forum/topic/71867-getting-more-out-of-filtered-portals-2view-selected-child/

  • Author

I wasn't paying attention when I looked at the file apparently, because I just assumed it was global, since that's what the "Magic Key" method calls for.

Yeah, Ummm. kind of an oversight on my part :idot:

I'm fixing the files now

  • Author

I adjusted the files to make the magickey fields global.

I had not made it global so it wouldn't keep the same data in the view fields when moving to another record.

Come to think of it, that's a problem using this type of view technique anyway, reguardless of how I am using it here with the magickey relationship and TOs.

You could use a global field with multiple lines - one for each parent/selected child combination.

See also (for version 11):

http://fmforums.com/...selected-child/

And this is a beautiful solution. I love this!!

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.