January 3, 200620 yr 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?
January 4, 200620 yr 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.
January 4, 200620 yr Author 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
January 4, 200620 yr 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.
Create an account or sign in to comment