September 15, 200421 yr 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 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
September 15, 200421 yr 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 ?
September 15, 200421 yr 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
September 15, 200421 yr 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
September 15, 200421 yr http://www.fmforums.com/threads/showflat.php?Cat=0&Board=files&Number=69442 OSX Portals http://www.fmforums.com/threads/showflat.php?Cat=0&Board=files&Number=90515 OSX Portal ScrollBars
Create an account or sign in to comment