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.

Get (ActiveFieldName) not working at all.

Featured Replies

For some reason the Get(ActiveFieldName) function is not working in any of the tests I've done. I click into a field, but the calculation field with the function in place never changes to reflect the name of the field that has the focus. It just remains blank.

 

The FileMaker website says:

 

Get(ActiveFieldName)
 
Purpose 
Returns the name of the field that has the focus.
 
Thanks in advance for any help. I'm sure it's something I'm overlooking.
 
Alex

Get (ActiveFieldName).fmp12.zip

Well, for one thing, the calc needs to be unstored.

 

But normally this would not be used as a calc field, it is more likely to be used in a script.

 

But - what is the purpose of the calc? 

GetActiveFieldName.fmp12.zip

  • Author

Thanks! The example file works great. I noticed that a script trigger was also tied into it to have the calculation refresh. I wish there was a way of just doing this with a calculation alone. I find it rather strange how a calculation can determine if a field is empty instantly in real time, but determining the name of the active field requires more steps and scripts.

 

Purpose of the calc

I was playing with the idea of hiding a merge field dependent on certain conditions. The merge field is a calculation field. I have a large text field on a layout as well for taking notes. The text field is transparent to have it blend in with a background color. Instead of using a traditional static label on the side or above the field, I added the merge field (calculation field) to the center of the text field. I then set the calculation to display "Notes" when the field was empty and to display "" (blank) when the field was not empty (filled).

 

The problem came when trying to type into the text box while it was originally empty from the start. While typing text into the field, the "Notes" text would remain on top, obscuring the foreground. I figured that by adding an additional condition to the calc this would fix. That's why I was trying to get the Active Field Name. To hide the "Notes" label if the Notes field was not empty (filled) OR if it was the active field (in focus).

 

This mainly occurred because the field is transparent, if it wasn't I could set the merge field to the back of the transparent text box and have the text box become a solid color when it was active OR not empty.

 

Is there any better way to tackle this, while retaining the transparency of the text field at all times? I could resort to a traditional label, I just felt a little adventurous and wanted to try out a new and more dynamic method.

The calculation actually updates as long as you have the correct data type for the calculation and it's unstored.  What doesn't always refresh is the screen.

 

If you create a calc field that only returns Get ( ActiveFieldName ), and place it on the layout...enter a field, nothing appears to happen.  No grab a corner of the file window and just change the size of the window.  You will notice the field update with the current active field.

 

If you create a new record, you notice that the field shows the initial field that has focus.  It has to do with the order of operations and when FM redraws the screen.

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.