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

Recommended Posts

Posted

Hello,

I have a typical row/column portal with labels as column headers.  I want to be able to click on a column header (a text grouped button) and pass the associated field name to a script that then sorts by that field.  I don't see a "Sort Records" or Sort Records by Field"  that supports a variable name for the field.  I notice that Sort Records by Field will use the currently active field if no field is provided - but I can't figure out how to "activate" the field using a variable.  I tried "Go To Object" where the variable is the Object name but I get an error [3] Command is unavailable.  This seems like it should be easy and I can brute force it with a case type structure but that feels really clumsy.  Anyone know a better approach?

Thanks

Posted
32 minutes ago, BAleiHi said:

how to "activate" the field using a variable.

Using an object name is one option. Hard to say why it didn't work for you without seeing exactly what you did.

Another way is to use the field name and loop among the fields until it matches.

And there is also the simple (albeit verbose) method of using If[] and multiple Else If[] steps, each with a hard-coded Sort Records step.

 

Posted

Thank you,

I ended up just using the If/multiple Else Ifs option (Case statement) to avoid the hassle of figuring out a more elegant way.  It makes the code much more readable which is nice but I feel like I'm back in Coding 101 doing it that way.  Oh well.

 

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.