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 not working - why?

Featured Replies

Hi,

I have an issue where sorting does not appear to work, either as a script or manually. Let me explain. I have an inventory table, line item table and a purchase order table. The purchase order layout has a portal to the line item table. The relationship from purchase orders to line items and inventory to line items works fine. I can add parts to the purchase order and adjust stock with the purchase orders. In the purchase order layout, I want to create buttons on the labels above the portal to sort the portal records by the label. Seems simple enough, but I can't get it to sort. Even if I go to sort, select the LineItem::Description field as the sort to field, select ascending, and press sort; nothing happens. Well, I take that back. The screen does "blip", but the sort doesn't happen.

I must be missing something obvious, but I can't think what it might be. Help...

Go to http://www.databasepros.com and click on Resources. Search for portal sort. There are several techniques.

  • Author

Thanks for the link. I found an article and example on there. From reviewing the example file, I see that it is not as straight forward as I thought it would be. The example I found uses a calculation in the sort setup of the portal. I was thinking that maybe there was a simple script. Possibly not. I'll keep searching.

"I was thinking that maybe there was a simple script. Possibly not. I'll keep searching."

Sure, keep searching... but you won't find a "simple script" to do it because you need to change the sort order of the *relationship* to change the sort order of the records in the portal.

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined. Or use multiple layouts instead of tabs.

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined.

I don't see a link to any specific method. AFAIK, the ONLY simple method is to use multiple portals in a tab control. It is also the fastest. Any calculated approach has to deal with different data types - and that's anything but simple.

  • Author

"I was thinking that maybe there was a simple script. Possibly not. I'll keep searching."

Sure, keep searching... but you won't find a "simple script" to do it because you need to change the sort order of the *relationship* to change the sort order of the records in the portal.

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined. Or use multiple layouts instead of tabs.

Sorry, I didn't mean to imply that I was getting a poor solution from Barbara. I am grateful for all the help I'm getting. There have been a few things in FM that I think must be easier to do than they appear. It's not that they are overly complicated, it's just that I wasn't understanding some of the structures used in FM well enough. Once I finally get the principal down, it all comes much easier.

Thanks again for the help.

I thought I had linked to JMO's portal sort solutions. He had several. I see that you can't link to a page, so go to Resources and search on Portal Sorts.

I don't think you change the relationship sort, Vaughan, just the contents of the field that the portal is sorting. So, the portal always sorts by SortFieldAsc then SortFieldDesc, and via script, you populate those fields.

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.