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.

Dynamic field referencing in script

Featured Replies

Not quite sure where this falls under so hopefully this forum is appropriate as it is part of a script.

How can I dynamically check the status of a field? i.e I have one script which runs, and I need it to check if(isempty(#field#) where #field# is whatever field they click on?

get(activelayoutobjectname) doesn't appear to work as it's not "active" if it's just clicked on :-S

TIA

If [isEmpty(Evaluate(Get(ActiveFieldName)))]

Show Custom Dialog [Quote(Get(ActiveFieldName)) & " is empty!";

Quote(Get(ActiveFieldName)) & " is empty!"]

Else

Show Custom Dialog [Quote(Get(ActiveFieldName)) & " is not

empty!"; Quote(Get(ActiveFieldName)) & " is not empty!"]

End If

  • 3 weeks later...
  • Author

Thanks but that's not quite right?

You are referencing an "active" field. But the field is not active. They are merely clicking on a "toggle" button that overlays the field. i.e

I have a load of checkboxes. Lets say 1 - 50 each one is called Date{number}_na

I want one script that when clicking on the checkbox, it checks the status, then runs the script accordingly. (I also want it to go to a dynamic related set of records but that's a whole nother story!)

I could do 50 if statements, but I want one that deals with the whole lot. So whilst in theory yours is right, merely clicking on the button doesn't "activate" the field.

I thought adding into the front something like


go to object[objectname:"Date"&Get(scriptparameter)&"_na"]

if[isempty(evaluate(get(activelayoutobjectname))]

 set field "1"

else

 set field ""

End If

but apparently not... (i don't think dynamic object names work like I've done). Have also tried setting a variable with the concatenated object name (i.e set $$object "Date"&get(scriptparameter)&"_na") but that doesn't work either :P-S

I hope that makes sense.

TIA

Edited by Guest

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.