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 6102 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is it possible to reference field names via parameters?

For example instead of using Table::Field could one use Table:;)$$Test where $$Test would be a parameter set to the name of the field?

I tried it and it does not work, is there a different way to achieve that or does it just not work?

I really do not have / need to use it but am just wondering if it can be done as it might be useful in my future projects.

Thanks.,

Posted

If I'm understand your question, and the field is called [color:blue]Test, then you Set Variable [ $$Test; YourTable:;)[color:blue]Test ]

If this isn't what you meant, let us know.

HTH

Lee

Posted

Not exactly. The example you put would get the value of the field into the parameter, not the field name and field name is not the issue - I might have poorly explained what I wanted so I will try again.

I am thinking of using parameters to reference field name, not field value. Something like:

1. Table Name is Weight

2. Field name is Test

3. Field name is Actual_Weight

4. Optional Script Parameter is Test

5. Set Variable [$$Field; Value:Get(ScriptParameter)]

6. Set Field [Weight:;)$$Field; Weight::Actual_Weight]

If I reference field name as seen in step 6 I get message field cannot be found.

What I am thinking is using the script parameter to reference fields in calculation rather then having to use field names if possible.

Hope the explanation is a bit better this time around. If not I can try again.

Thanks.,

Posted

You can not use Set Field [] dynamically like this.

Posted (edited)

Could it be used vice versa in any way?

Instead of

6. Set Field [Weight:;)$$Field; Weight::Actual_Weight]

like this

6. Set Field [Weight::Actual_Weight; Weight::$$Field]

Thanks.,

Edited by Guest
Posted (edited)

For the first thing (setting a field dynamically), you can use a plug-in such as DoSQL, or a loop on a layout until the active field name is what you want. You can also use GoTo object.

The problem with these two is that you need to be sure the field is on the layout. This is what FM xLayout Assistant does for you (delivered with a FileMaker script to set a field dynamically).

As for your second request, as Comment said, you have the Evaluate function, and even GetField, which is supposed to be a little faster.

Edited by Guest

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