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.

Featured Replies

Hi

Here is what I want to do. I have a form with a portal in it. I want to sort the portal within a script. Can anyone tell me the steps. I use "Sort Records" and then give it the "PortalFieldName" but this does not seem to be working...

Thanx in advance...

Portals can only be sorted in the relationship definition or the Portal Format dialog. You can define a sort based on a dynamic field, however. Do a search for +dynamic +portal +sort. I believe Ugo and others have posted several sample files demonstrating how this can be accomplished.

  • Author

I have done the following

In the Portal, I have a global field called SortKey. The portal also has a calculation field called "SortValue" and the calc is GetField(sortkey).

In the parent layout, I sort the portal using the values in SortValue field.

Eg: User presses "Last Name" button, then I execute a script which has the following:

SetField(SortKey, "LastName") where LastName is the field name in related file.

The Calc field then gets all the values from LastName field. This works fine.

The Sorting does not work even though I have the right values in SortValue Calc field....

I cannot figure out why...

What does the Sort Order in your Sort Records step look like?

  • Author

I do not have a Sort Records Step in the Script. In portal layout I have defined it to sort by the "SortValue"...

  • Author

The "SortValue" is defined to sort in Ascending order. I have put the SortValue field on the portal but the sort does not work.

Do I need to have the relationship re-built or portal refreshed to make it re-sort. If yes, can someone tell me the steps....The Help in FMP 7 says that re-sorting of the portal happens when the match key changes (field on which the relationship is based on) OR when the field leaves browse mode (I do not know what this means)...

Thanx

Hi,

You may try SetField[yourPortalKey; yourPortalKey] as a start, and then Commit Records, so you'd be doing both what the FMHelp recommand. laugh.gif

Also, the preferred place for the global is in the related file.

At least, this was the case in former version. Didn't implemented Sorts on portal currently withthe new version.

  • Author

I will try that. Which global field are you referring to ?

The SortValue and SortKey fields are in the related file

Thanx

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.