Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

portal sorting question

Featured Replies

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

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

  • Author

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!

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 ]

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.