Jump to content

Scripted Sort


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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2861 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.