Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Using Magic Key To Create And View Related Records


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

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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 :)

Posted

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.

Posted

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:

Posted

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/

Posted

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

Posted

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!!

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