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

Sorting by date in a self-join relationship?

Featured Replies

In my current solution I have a sorting script that enables users to sort by date (for a date field) but I just can't figure out why, in a self-join relationship, I can't get the dates to sort within the portal; the sorting script works fine when queueing records to print, it's only within the portal I can't get the records to sort. I disabled the "Sort Portal Records" checkbox within the portal so that's not locking the sort into one direction or the other.

Am I missing something, or...?

The order of related records needs to be set either in the relationship's definition or in the portal setup. Sorting found records has no effect here.

See also:

http://fmforums.com/forum/showtopic.php?tid/202466/

  • Author

Tabs? I never would've thought of that. Very clever!

Thanks again for your help!

  • 6 months later...

The order of related records needs to be set either in the relationship's definition or in the portal setup. Sorting found records has no effect here.

Does this explain why trying to add a sort step in a GTRR script has no effect?

(I use a scripted button to bring up a related table with records related to the line in the portal, in a new window, but i cant get the records in the new window to sort with the script... ???)

@cbum - You should be able to gtrr new window in a list view and sort.

@cbum - You should be able to gtrr new window in a list view and sort.

I'm not opening into a list view - does that matter?

I'm simply using GTRR to pull out the related records in the second table. I correctly land on the record I had clicked on in the starting portal in the first table, but the records in the new window with the found set of related records is unsorted, and adding a sort step to the script has no discernible effect... why?

(I would like to sort the records by date, so that if necessary, one can read additional records chronologically)

What is the view in the new window if it's not a list view? What do you mean by "pull out" the records? How can you land on the record in the portal if you are gtrrs? You said, "related table with records related to the line in the portal," which to me, means child records of the visible portal record.

Perhaps you should post your script and a description of the functionality you require.

I'm not opening into a list view - does that matter?

No.

the records in the new window with the found set of related records is unsorted,

Actually, it is sorted in the same order as defined for the relationship (which may be none).

adding a sort step to the script has no discernible effect... why?

That is the weird part here, since it should work. The only thing that comes to mind is that you may be trying to sort by a field from another TO of the table.

This is the simple script attached to the button, which is in the portal row, ie repeated on all rows visible in the portal window:

Go to Related Record [show only related records; From table "EPR"; External: Using Layout: "EPR" (EPR); New Window]

Sort Records [Restore; No dialog]

The initial layout "External Data" has a portal linked to the related table "EPR" in a one-to-many relation.

After clicking the button, The related table comes up in a new window, with just the related records "found", and the record clicked on in the portal is the one open in the second window. But the found set is unsorted, so navigating to other related records is random instead of sorted by date.

The portal itself is sorted by date.

I have tried with and without a sort by date defined in the relation, no change in behavior.

I really wonder what I am missing here.

Go to Related Record [show only related records; From table "EPR"; External: Using Layout: "EPR" (EPR); New Window]

Are you switching to another file here?

Are you switching to another file here?

correct.

Does that make a difference?

Does switching to another file matter? Yes.

You describe a script in file A:

Go to Related Record [show only related records; From table "EPR"; External: Using Layout: "EPR" (EPR); New Window]

Sort Records [Restore; No dialog]

But the sort operation in that script cannot work because you are no longer in file A. You would need to place the sort script in file B and the file A script would call the sort script in file B.

Does switching to another file matter? Yes.

You describe a script in file A:

Go to Related Record [show only related records; From table "EPR"; External: Using Layout: "EPR" (EPR); New Window]

Sort Records [Restore; No dialog]

But the sort operation in that script cannot work because you are no longer in file A. You would need to place the sort script in file B and the file A script would call the sort script in file B.

Thanks, that was what I was missing ;-)

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.