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.

Getting the Active Layout Object Name

Featured Replies

Hi

I have a series of 50 objects (not fields) on a layout. I want to format each as a button to run the same script with the exception of one variable. That variable happens to be 1 through to 50.

So I named each object 1 through to 50 and used

GetAsNumber (Get (ActiveLayoutObjectName) )

to set a variable, hoping to get the number I wanted into the script. It only returned a "?".

Reading related threads (Post#271689, topic id 189716) I noticed someone advised that an object is only active if the cursor is in it, so if this is the case the object would have to be a field and entered to return the object name?

Is there an easier way without having 50 almost identical scripts?

Use script parameter instead.

As you've found, you can't use Get (ActiveLayoutObjectName) for buttons that way. What you can do is pass the numbers as a ScriptParameter of each button.

  • Author

Thanks. I've read the FM help on Get(ScriptParameter) function. I've never used Let, Evaluate or Get(ScriptParameter) before and I'm not sure where to start here. Can either of you pls give an example of how to make each button use a different number in the script?

So your script starts with something like:

Set Variable [ $var ; Value: GetAsNumber ( Get ( ActiveLayoutObjectName ) ) ]

Instead of having the $var with a number from 1 to 50 ( not possible in your way ), you'll use the Script Parameter.

To do so, you do not need to name each object, but to give different numbers ( from 1 to 50 ) into the place for the script parameter that you can see when apply your script to each object.

The value that you'll insert will be passed to the script and retrived with the Get ( ScriptParameter ) function.

  • Author

OK now I get it. Thank you very much.

Phil

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.