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.

Variable table name in script

Featured Replies

Hi there,

I'm trying to avoid writing multiple scripts to do the same functions for different tables...and I've run into an issue with trying to use a variable table name in my script. I'm setting the table name in a global variable in a script parameter, then in my script I run into problems with this:

Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table and "::MEDIA_ID")]

the resulting variable $mediaID = '?'

Unfortunately the table name that I need is not the current layout table or I could use Get(LayoutTableName).

Does anyone have any suggestions for me? I've been banging my head on it for a bit now...

Thanks

rori

Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table and "::MEDIA_ID")]

Try

Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table & "::MEDIA_ID")]

instead. That will address the syntax problem.

But I think you may need just

Set Variable [$mediaID; Value:$$MEDIA_table & "::MEDIA_ID"]

since you are constructing the fully qualified field name directly. If I recall correctly the GetFieldName() function will prefix the field with the current layout's table name which you state is not the case for you.

Edited by Guest

  • Author

Set Variable [$mediaID; Value:$$MEDIA_table & "::MEDIA_ID"]

Brilliant, thank you!

I'm curious how this works. How does FM know which record's ID to grab if you're not on the record?

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.