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.

How can I make this work: grab button bar segment (button) name

Featured Replies

Howdy all:

For the life of me, I can't figure out how to get this custom function ( https://www.briandunning.com/cf/1943 ) to work. I've attached a rudimentary file where I want to grab the button name and pop it into a global variable. Is the suspect the Get ( ActiveLayoutObjectName ) argument in the calculation, or...?

I'm sure it's something simple, just that I'm in Stupid Mode again. : P

Thanks,

Rich

Test.fmp12

If I read your file correctly (I only glanced at it) there are at least two issues here:

1. The custom function requires passing the button bar name. Your button bar does not have a name.

2. Even if the button bar had a name, it would not be returned by Get(ActiveLayoutObjectName).  Clicking a button bar does not make it the active layout object. That can happen only by tabbing into it.


What exactly are you trying to accomplish here? If you want the script to know which button you clicked, you can simply pass the button's name (or any identifying value) as the parameter, without needing all this rigmarole.

 

Edited by comment
Corrected a misconception about timing.

  • Author

I was close--I named the button segments, but not the button.

The goal is simple--I just want to grab the name of the clicked button (segment) so it can be passed to a script and be made into a variable.

Edited by 21st Century Man

2 hours ago, 21st Century Man said:

I just want to grab the name of the clicked button (segment) so it can be passed to a script and be made into a variable.

And then what? Populating a variable is not a purpose by itself. As I already mentioned, you could simply pass the value of 1, 2 or 3 as the parameter. Then your script will know which button was clicked, without you having to assign object names to them and to the enclosing bar and without an elaborate custom function trying to figure out something which is already known.

 

  • Author

It's for navigation purposes between the many layouts in the database. The idea is that with so many layouts and button bars around, there should be one script to handle all the navigation; by assigning variables to pass to the script it would make it easier to code. That's my logic, anyway....faulty as it may be. : P

1 hour ago, 21st Century Man said:

there should be one script to handle all the navigation

One script, yes. One parameter, no.

But I am not out to convince you against your will.

 

Edited by comment

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.