BAleiHi Posted May 16, 2024 Posted May 16, 2024 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
comment Posted May 16, 2024 Posted May 16, 2024 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.
BAleiHi Posted May 16, 2024 Author Posted May 16, 2024 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.
Søren Dyhr Posted May 17, 2024 Posted May 17, 2024 15 hours ago, BAleiHi said: that supports a variable name for the field. A buttonbar would provide the display of variables, this and the hide of segments will provide the animations of icons giving the chosen sortorder. https://community.claris.com/en/s/question/0D50H00006h90ubSAA/can-i-sort-a-portal-with-a-button --sd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now