Jump to content

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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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.

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