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.

Script is clearing a GLobal field . . . why?

Featured Replies

I have a little record -creation script set up in part of my solution that involves a little pop-up window with several Global fields on it that the User fills in before hitting a "Create" button that triggers my script, which goes to the relevant layout, enters data in the various fields, then goes to a different sub-table and creates some records there before going back, clearing most of the globals and heading back to the original screen. It works fine.

EXCEPT, bizarrely, if the User leaves a field called ARCHIVE_gl empty. In this case, the script runs as usual, and *mostly* works . . . but a few of the global fields seem to get 'Emptied out' temporarily along the way.

Attached is a picture of the first chunk of the script. The first field that 'fails' is the Project title field that gets filled with the Globals::zzz_GrantStatusNew_gl (just above the Script Debugger progress arrow).

Viewing the globals in the Data Viewer, I discovered that when the Script executes the "Go To Layout [X_RAWgrants" (Grants)] " step. the GLobal field gets cleared out in the Data Viewer.

If I cancel the script and go back to the layout with the GLobal fields on it - - - the field is still displaying the original value!!!

Can anyone suggest what might be going on? I do have a Relationship in the TO this layout on that uses the Global Archive field that seems to be the root of the problem -- but (a) I can't see why the other Global fields wouldn't be affected similarly -- and at any rate, I thought that Global values persisted in a database regardless of Layout and context?

What could cause a change of Layout to clear a Global field . . . temporarily?

post-91156-0-00092100-1332206531_thumb.j

It isn't really a global field in the first place?

Hi Wickerman

I can't be certain how your globals, grants and deliverables tables are related without seeing your relationship graph

When your script switches layouts from x_Rawgrants (grants) to x_rawDeliverables (deliverables), it is likely that Globals::zzzGrantStatusNew_gl does not have a direct relationship with deliverables and therefor will not appear on the Current Tab of the data viewer.

Try adding it to the watch tab and check it's value after your script has switched layouts

HTH

Brian

  • Author

omigosh -- sure enough, I didn't have the field set to Global storage. I am humiliated.

My eye was draw to the uniform _gl strings at the end of my Fieldnames and read that as confirmation that they were global fields, rather than seeing the field options column.

sorry for wasting your time. is there a forum where I can advertise for a new brain?

Me too. :yep:

make it 3 !!

Yep me too too (4). A good call by Bruce for picking it up first go. :)

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.