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.

Global as match field

Featured Replies

OK, haven't done much FM lately so perhaps my brain is rusting up. What I want is a relationship between a global text field and a regular text field. I know globals aren't indexed, but I still thought they could be used as the left hand side of a relationship. But it isn't working.

I've attached a quick example. gTest = "Hello". When Test = "Hello" the relationship should match and the text tag "Working!" should show up in the 1-row portal.

But, sadly, it isn't working at all. "Working!" shows up on every record. What am I screwing up? The only way I can get this to work is to set gTest to be non-global with "Hello" as auto-entered text.

Thanks for any brain lubricant you can provide.

Dan

test.zip

You are right, a global can be used on the left hand side of a relationship.

However I have noticed that in FM7, as opposed to FM6 where this worked with no problem, if the global field is defined in the same table as the related data you are trying to access, the relationship does not work. I had to create a global field in a separate table to get this to work. I am not sure if this is a bug in FM7 or design intent.

Hi Dan,

Your demo had me mixed up too. The relationship is working correctly. Remember, a global on the left side always shows the same set of related records no matter what record you are on. This is why you might use a global alone as a left-side key.

Put the global in a separate, related table.

Put the global in a separate, related table.

This is not necessary. As I said, the relationship works correctly.

  • Author

Thanks, guys. I don't know, Ender. Maybe it was working, but it sure wasn't doing what I wanted it to. wink.gif In record 1, "Hello" matches "Hello". All well and good. But in record 2, "Hello" matches "World". In what sense is that working? I'd say Echo33029 and Transpower were right on the money.

I'd say this is a bug. In fact, it seems to go a little farther than Echo suggests. In my real-life problem (rather than the stripped down dummy version that I posted) the related data on the right hand side was already in a seperate table from the left-hand global and it still didn't work. It wasn't until I moved the globals into yet another table that the layout wasn't based on that I got the intended result.

FM could make this a lot easier by letting you define a constant as the LHS without having to set up a global field to achieve the result. Ah well, maybe FM8 or FM9 will get to that.

Thanks guys,

Dan

Dan,

With Ender: I'm quite sure this is *not* a bug.

What FM is doing is this: in the one-line portal, it's letting you know that in the *first* encountered case where the LH key is matched by data in the RH key field of a record, the value of the text tag in *that* record is "Working!". You might have situations where you *want* that behavior...

It seems what you want is the other way around: you would like to have each record compare itself to the global and report "working!" if it matches the global. But to do this you want a calc field: Case(Test=gTest,tag). No? Was there more to your situation than what I'm grasping?

Hi Elise! Where you been hiding?

Yeah, I have a global key self-join like this in my FM6 solution that does exactly this. It's part of a navigation system to allow a user to select a school and classroom to jump to. So no matter which record you happen to be on, you always see the same records in the portal based on this global key relationship.

It behaves the same in FM7.

  • Author

Hey Elise,

No that's it. You've given me the brain lubrication I was looking for. You should be a professor or something. wink.gif

Thanks,

Dan

And you must be psychic or something!

Where I been hiding is exactly behind piles of papers. (Actually "papers" is just a metaphor now. Everything is submitted and handled via FM7 with SMTPit. So I can always find an excuse to take a break from grading to look under the hood and tweak things. : ))

  • Author

Nothing like good old-fashioned procrastination. I was procrastinationg one day and snooped around your home page. Very nice. I find your professional work to be quite interesting. Have you ever written anything on how we make ethical evaluations across time? I'm interested in how Thos. Jefferson and other slave-owning founders are treated, and I often wonder how future generations will judge us for things like eating meat, engaging in armed conflict, using Access when we cold use FileMaker, etc.

Well, way way off topic for this forum. E-mail me on the side if you feel like it.

Thanks for the help,

Dan

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.