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.

sorting of a portal that is based on a valuelist

Featured Replies

Let me begin.

To avoid all those nasty habbits of the standard portal i use valuelists and my own script based scrollbar. This technique has earlier been suggested in this forum, it works great. Now i have a question concerning how to sort in the portal.

1]

I have a child database with the following fields

Class

Name

Age

RecordId

2]

i have a parent database with a (global)field

SearchClass.

3]

I have a relation between SearchClass and Class in the child database. This relation is called Contacts.

4]

i have a valuelist based on Contacts that contains the recordid of the records ; ContactsVL

I have calculated field ; DisplContacts=valueListitems(database;"ContactsVL")

5]

I have a calculated field : ContactsinPortal=MiddleWords(DisplContacts;startindex;endindex)

6]

i have a relationship between ContactsinPortal and recordid in the cchild database B) ContactstoShow

Now you can see that based on startindex and endindex a number of recods are shown in the ContactstoShow portal.

sorry for the long story.

Now my question is;

what should i do to be able to sort the records in the ContactstoShow portal on Name or on age.

Should i build different Valuelists?

Should i build different relations

anys suggestions are welcome because now i am stuck.

Jitse

Hi,

If you have FM5.5, then you can use a calculation with GetField( ) as your sort key for the portal relationship.

The field inside would be a global, which you'd populate by script from the Parent file.

Are you using script portals with FM7 ?

  • Author

Thanks for your response.

Maybe i do not understand your answer completely.

I my situation i am not able to sort because of the valuelist ( a valuelist is sorted alphanumeric i think).

could you please elaborate a bit more on your suggestion.

Thanks a M

Jitse

and i am using FM 5.5

Hi again,

Sorry for the confusion.

Your scripted Portal is not enough scripted, and the technique you're using wouldn't help in the case you want the list sorted.

What you need is, in FileMaker 6 :

1. A constant relationship from Main To Related and Vice Versa

2. Set a globalKey gIDs with ValueListItems(MainFile,"relatedList") in the Parent File

3. GoToRelated Records through a relationship gIDs--RecordIDs

4. There, Sort [by your selected Field]

5. Still in Related File, move to a layout with only the IDs in it

6. Copy All Records

7. Go To a Layout with another global gTempKey

8. Paste

9. Set MainByConstant::gIDs with content of gTempKey

10. Back to Main, now you can use index start and end with this gTempKey

The Sort step is actually not necessary if your relationship gIDs--RecordIDs is already sorted (see Menu ->Define Relationships), although I've seen situation where it wouldn't sort as required.

If you need more about Fixed portals, there are lost of posts around that explains and demonstrate this technique.

I've got one in the Sample Forums calles "OSX Custom ScrollBar", and "OSX Portal", the second of which demonstarting the sort stuff

HTH

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.