Jump to content

Relationship based on global


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

Recommended Posts

I have a global calc field, gA, in Table I. Its result is based on another another global field, gB. Table I has 0 records -- it just holds the global values.

I have a layout based on a second table, Table II. (Table II is in another file, but that shouldn't matter.) On this layout I want to use the portal visibility technique to show objects based on gA, so that if gA=1 the portal is visible, otherwise it is hidden.

Table II has a field C, which is an auto-entered text field with a constant 1. I've created a relationship between gA and C, and placed a portal based on this relationship on the layout.

So, if gA=1 and C=1 (by definition) the portal should display objects. But this isn't working. If I put gA and C directly on the layout they show the correct values. But the relationship doesn't work right.

What am I doing wrong?

Link to comment
Share on other sites

Yeah, that's basically what I've been playing with. It seems to be getting screwed up on the globals. If I make gA a plain number and set it manually (or with a script eventually) it all works. (It can, in effect, act like a global in this situation since the table can have just 1 record and it will be a constant for all users.) If I make it a global calc or just a regular calc it doesn't work.

This may be something of a bug. If I set up a field as a calc, immediately go to the storage tab and set it as a global, and then define the calc, it accepts it. If I set up the calc field, define it, and then try to set the storage option to global, it tells me it won't work since it is referencing another global field. Weird.

Anyway, thanks for the help. All this would be solved if FM would get more object oriented, and let us directly disable or hide objects based on calculated conditions. When is FM 8 due? smile.gif

Thanks,

Dan

Link to comment
Share on other sites

Yeah, that would be great, I fantasize about using properties, maybe something like:

SetProperty( Get( LastButtonPressed ); "Caption"; "Processing..." )

To change a "Run It" button to "Processing" while the script is working on whatever.

I've used Delphi a lot, and everything had dozens of properties for every object that were controllable like that, it rules. Things like that allow being able to make a portal larger automatically when the window is resized - very nice.

Link to comment
Share on other sites

Ah, clever. I'm still putting this all together in my head. Thanks.

I was hoping not to have to rely too much on using the data table since I'm trying to split the data from the script / layout file. But if I use a 3-file separation model (data, script/layouts, and calcs) then I should be able to build this into the more-easily-modifiable calc file.

Thanks again,

Dan

Link to comment
Share on other sites

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