Skip 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.

Can one reference fields INDIRECTLY in scripts?

Featured Replies

  • Newbies

Hey,

I see Script steps that allow me to go to a layout or record by a number. But is there any way to reference a FIELD indirectly? Eg, to go to, copy from, paste into, or set a field without specifying a specific field-name, but rather specifying a global VARIABLE which POINTS to the desired field (by number or name), so that I could use a loop to change 40 fields without doing them 1 at a time.

Thanks!

Eliot

Version: v5.x

Platform: Mac OS 9

GetField() allows you to "indirectly" reference a field. If you named your fields in a pattern like "Field1", "Field2", you could construct a tight loop using GetField("Field" & NumToText(myCounter)). Of course, naming fields without meaningful names is a programming no-no...

  • Author
  • Newbies

Thanks Sam!

I did get the GetField(field) function to work, but after your response, I was hoping to be able to write something like:

Set Field ( GetField(CurCategory), RunningSum)

... but the Set Field ScriptStep seems to take only literal references (ie, a specific field name) for the first parameter. (I'm using FM5).

So... 1) Is there a way to SET (or Paste, or whatever), as well as Get, with indirect reference?

And 2) Can one use GetField and any indirect SetField to reference fields in RELATED records?

Here are the work-arounds I am considering. Are there betters ways?

Re 1: If there is no set function with indirect reference, perhaps the best thing is to create a layout and use "Go To Next Field" and then Paste into it.

Re 2: If GetField doesn

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

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.