paulmild Posted January 26, 2015 Posted January 26, 2015 Hello Is it possible to have a single script step that can be used to Sort on a number of different layouts each using records from different tables but where the sort field always has the same name - Type I thought of setting the Sort field something like a global field in a Globals table that evaluates Get(LayoutTableName)&"::Type", or a variable but cannot figure out how to use this in Filemaker's Sort function. Thanks Paul
jbante Posted January 26, 2015 Posted January 26, 2015 No. The Sort Records by Field script step is the closest you can get. If you leave the sort field unspecified in the script step, it will sort by whatever the active field is at the time the script step executes. You still need a way to make the field you want the active field. The Go to Field script step doesn't let you specify a field name by calculation. However, you can name the field object on your layout, for example "Type", and Go to Object: Go to Object ["Type"] Sort Records by Field [Ascending] // no field specified Another option that you could use to sort on a field (or several fields!) specified by name is the Virtual Sort module; but you should see if the Sort Records by Field step does what you want first.
Lee Smith Posted January 26, 2015 Posted January 26, 2015 Are you aware that you can click into a file you want to sort and right click and choose a sort? Or go into table view and sort on the header?
paulmild Posted January 26, 2015 Author Posted January 26, 2015 Lee - Yes thanks, but this is for a multi-user application where as much as possible is scripted. jbante - Using your Go To Object Suggestion works great. Thanks
comment Posted January 27, 2015 Posted January 27, 2015 jbante - Using your Go To Object Suggestion works great. Yes, that will work in your described situation. However, you should consider if the described situation is a good one to find yourself in. I suspect there is a deeper structural issue lurking behind this - and you would be better off solving this instead of one of its symptoms.
the Otter Posted January 29, 2015 Posted January 29, 2015 If this is a Mac-only implementation, you could also use Perform AppleScript: http://fmforums.com/forum/topic/51162-sort-records-in-filemaker-with-applescript/ I do this often, and it works beautifully!
Recommended Posts
This topic is 3585 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 accountSign in
Already have an account? Sign in here.
Sign In Now