Jump to content

Can the value in a global field update automatically when the active record changes?


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

Recommended Posts

HI all,

I have a global field that mirrors the Key field's value of the active record on a layout. I need it to update with the current record's Key field value as I flip through the records. I was hoping there would be a function such as "Get(ActiveRecord)" that could be used for this, but perhaps there's something with a different name. Anyone know?

Link to comment
Share on other sites

It actually has to be a global field that changes to corrospond to the active record's key field value. The field needs to change to mirror the active record's key in order to establish a dynamic relationship that highlights a portal row specific to active record. I need for the highlight to change portal rows as you flip through records WITHOUT having to click a button or run a script.

I hope this makes sense. Anyone have any ideas?

Link to comment
Share on other sites

Myron,

I've tried to use global fields in a similar way. I was able to update the global field using a simple script. A script was required. However, the change in the global is not saved to the database even if you commit the record.

If you have only one portal row related to the key field from another table, why are you using 2 separate tables? If there is more than one portal row related to the key field from another table, using the key field will not specify which portal row you want highlighted. Only the key field from the table containing the fields you display in the portal will specify a particular portal record. In the later case you would not need to set a global field.

Sailor1

Link to comment
Share on other sites

It's kind of hard to explain without going into details of the entire solution, so some might wonder why I'm doing this. But the portal on my layout lists all the records in the current found set, usually only about 10 records. It's intended to give the user a "big picture" snapshot of where he's at among the records in the found set.

The portal is made possible through a self-join, and my need for a global field containing the currently active record's key is so that the active record in the portal is highlighted as you flip through the records. I would like the highlight to move around the portal rows according to which record you're on without having to run scripts.

So, this is where I was hoping for a simple funtion such as Get(ActiveRecord)to solve the problem.

Link to comment
Share on other sites

This can be done, using an unstored calculation field =

Let ( $activeID = SerialID ; "" )

This field MUST be present on the layout. To highlight the corresponding portal record, define another unstored calculation field along the lines of:

Case ( SerialID = $activeID ; <> ; <> )

Note that when you enter the layout, the highlight may not evaluate properly (or not at all), so you might want to script that.

Link to comment
Share on other sites

  • 1 month later...

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