Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4307 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

  • Like 1
Posted

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.

Posted

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.

This topic is 4307 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.