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

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

Recommended Posts

Posted

Is there any way to pass a field name as a parameter, to use it on a Go to field step?

I have 10 different buttons and 10 fields. When the user press each button, a script is run passing the optional parameter. A different parameter is passed with each button. This parameter is a field name. Then, I would like to use this parameter in the script to go to the corresponding field: button1 > field1, button2 > field2, etc.

It would save me a lot of scripting because I can use one script for all the buttons. If I can further enhance it and pass the vfield name, then only a couple lines should suffice for many different fields.

I was thinking in something like:

Go to field ( Get (ScriptParameter))

but I cannot find a way to script it.

Thanks

Posted

bluearrow, it's a complex subject but need not be; at least (I believe) for the type of functionality you require. Here's a sample of two views: First is using script parameter to specify the field the cursor should go to (passes field name). I use (the powerful) Exit Loop If[ ] because it has the ability to FIND a field easily even though not directly specified.

It is of course, part of what's being discussed in the thread Daniele referenced but I thought an example might be of benefit. Parameters on the buttons and concatenated test within an Exit loop If[] controls where the cursor STOPS; which is (in reality) not much different than specifying which field to go TO.

The wave technique in the file is a cheap, lazy example of producing effects to draw the eye of the User. I have yet to succeed running it through repetitions tho - it always stops at the second rep. But sometimes I'll use it for a quick flash to draw attention somewhere on the screen without having to result to pulsing paused scripts, etc. I make it look better than this of course. I just wanted you see some flexible options using a method that sounds complex or convoluted. It works quite well when the needs are simpler.

LaRetta

TheWave.zip

Posted

Thank you both for yuor replies. I read the topic and reviewed the sample file. The first example in this file was exactly what I needed. I tested it and it is working fine, going to the field stated in the parameter.

I am a little bit reluctant to use looping scripts though, but I will try to find a way to control what happens if something goes wrong (for instance, if the field name is changed, but not the parameter passed to the script...)

I wish FileMaker would add in the next version the posibility to pass the parameter directly in the Go to field step, or in Set Field.

Thanks again.

Posted

Hi LaRetta

do you remember our Loop/Exit Loop discussion ?

Your file is a good example were is better to place the exitLoop quickly after Loop ! :)

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