Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I've created a container field and attached a button to this field. When I click on the button it activates a script.

The first item in the script is to set field [a text field] Get(activefieldname).

When you click on the field button it does not recognize this as the active field.

I have a work-around by having the field button perform set field and manually entering the data. I have another button which activates the remaining parts of the script.

Is there a way to get around the two step process?

Posted

If the button is attached to a field, then the name of that field is known in advance. So you can put that name into a script parameter and use that instead.

Posted

If I follow this would work but I would need a different script for each field. My objective is to have one script work for any field that it is attached to.

I've attached a sample file. Across the top are 3 fields if you select one of the fields and click Display Name, the Name of that field will be displayed.

If you click on the Blue or Green Fields with the "Display Name" Script Attached nothing happens. Filemaker does not recognize the attached field as the active field.

Button_Test.fp7.zip

Posted

As Comment said, if you know the name of the field in advance, you can pass the name as a Script Parameter to one central script.

When you specify the button, you can choose to enter an Optional Script Parameter. Then in your script 'Display Name', use the Get (ScriptParameter) function.

The reason why you cant use the Get ( ActiveFieldName ) function is because when you click on the button, you are technically not activating the field since you never enter the field but rather are clicking on it as a button.

This topic is 6900 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.