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

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

Recommended Posts

Posted

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

Posted

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.

Posted

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?

Posted

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

Posted

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.

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 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.