Jump to content

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

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

Put the global in a separate, related table.

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

Posted

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

Posted

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?

Posted

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.

Posted

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

Posted

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

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