Jump to content
Server Maintenance This Week. ×

portal sorting question


mikerobertson

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

Recommended Posts

hi...new to the group smile.gif" border="0

i have a problem that has been puzzling me for awhile...

i'm writing a new solution which has a portal being used as a queue. i want to sort the portal by different fields by clicking on a header above the listed items very similar to a finder window or windows window. i define this sort order of course in the "define relationship" dialog, but that means i have to change the actual relationship to sort differently, which of course means making lots of layouts with the new portal, lots of duplicating and rewriting scripts. i'm allergic to all of that duplication and changing! also, i want different users sharing the same related file to all have their own sort order.

can anyone help me?

thanks

Link to comment
Share on other sites

The only other way to change the sort order is to change to contents of the field sorted upon in the related file. I haven't tried this, but how about creating one field in the related file for each of the sort orders you want. Create a calculate SortOrder field in the related file by selecting the contents of one of these orders using a global select field (now the calculated sort SortOrder field is unique to each user). The downside is that you must create all these order numbering fields every time a record is added to the related file. If record addition is frequent, this is a problme

I guess the choice is doing the development work one or paying with a long script every time records are added.

-bd

Link to comment
Share on other sites

thank you, this actually worked pretty well...i was skeptical about the speed of doing it that way, but with a related file with 20,000 records, it was pretty speedy still.

i haven't tested it with multiple users yet, but the global idea was my missing link...i had considered a solution like this, but didn't have the global used. actually, i didn't know or had never thought about the idea that filemaker would hold independent results for each user when global fields are involved in a calc.

thanks!

Link to comment
Share on other sites

quote:

Originally posted by mikerobertson:

hi...new to the group
smile.gif" border="0

i have a problem that has been puzzling me for awhile...

i'm writing a new solution which has a portal being used as a queue. i want to sort the portal by different fields by clicking on a header above the listed items very similar to a finder window or windows window. i define this sort order of course in the "define relationship" dialog, but that means i have to change the actual relationship to sort differently, which of course means making lots of layouts with the new portal, lots of duplicating and rewriting scripts. i'm allergic to all of that duplication and changing! also, i want different users sharing the same related file to all have their own sort order.

can anyone help me?

thanks

You can instead define, in the related file, the scripts you need to accomplish your different sorts and launch them from the master file.

Obviously uncheck, in the master file, the predefined sort order in the 'define relationship' dialog box.

For clarity, you can 'BUTTONIZE' each one of your headers and attach to them the external scripts you.ve built in the related file.

This will accomplish the job without burdening the db with extra fields and calcs.

For any question...... don't hesitate to post.

Regards

[ November 15, 2001: Message edited by: JPaul ]

[ November 15, 2001: Message edited by: JPaul ]

Link to comment
Share on other sites

I don't see why you need to create a whole bunch of extra fields. You only need one calculated SortOrder field, and a global field to tell which of the portal fields you want to sort by. The formula for the SortOrder field would be:

Choose(gSortBy,Field0,Field1,Field2,Field3,Field4)

When you click in the header, you execute a script to change the value of gSortBy to one of 0,1,2,3,4.

Link to comment
Share on other sites

This topic is 8197 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.