Jorgen Posted May 2, 2008 Share Posted May 2, 2008 Hi There, I have a problem with sorting a portal.Opps! In table 1 i have a field wich is a global-auto enter data with number 1 in it. In table 2 i have a field witch is also global-auto enter data with number 1 in it. This is the relationship. The layout is set to show records from table 1. The portal is set to show records from table 2. This portal shows all records and on "nameID" order sorted Until here OK. I created 2 buttons with a script to sort on the field "Name" and a button to sort on the field "NameID". Both scripts won't sort and shows records only in the "nameID" order. This portal and the relationship are both not set to sort. What can i do to sort the portal on the "Name" field? p.s. In the book "Using Filemaker 8" something is written on page 495 but i can't figure it out. Thanks for helping! Regards Jorgen Quote Link to comment Share on other sites More sharing options...
Inky Phil Posted May 2, 2008 Share Posted May 2, 2008 Hello Jorgen You can use tabs to achieve what you want. Create a tabbed area with 2 tabs. Duplicate your portal into both tabbed elements but set one portal to be sorted by id and the other one to be sorted by name. You set this sort order by right clicking the field and selecting portal setup. There you will find the option to sort the portal. All you have to do then is create the tab headers to indicate which sort order the user can select hth Phil Quote Link to comment Share on other sites More sharing options...
Jorgen Posted May 2, 2008 Author Share Posted May 2, 2008 Hello Phil, Thanks for the reply. I was familiair with the tab and portal posibilitys and the sort possibilitys. Though my problem is that i really want to sort them in that tab with this one portal. Anyway, i think it's a major problem to sort it out so i take your advice and create a second tab Phil. Thanks for the help!! If there's anyone who has an solution for this problem...... Regards en thanks Jorgen Quote Link to comment Share on other sites More sharing options...
Jorgen Posted May 3, 2008 Author Share Posted May 3, 2008 Hi again, i found the solution!!smiley-laughing I found this articile on the net and is found on: http://www.nightwing.com.au/FileMaker/ 1. Create a value list in the main file called 'Sort_Key' which lists the names of the different fields in the related file that you wish to be able to sort by. 2. Create a global text field in your related file called 'gSortKey', place it on the layout in your main file above your portal, with a label that reads 'Sort related records by:', then go into 'Field Format' and define gSortKey field as a pop-up menu based on the Sort_Key value list. 3. Create a calculation field in your related file called DynamicSortValue, with the formula: GetField(gSortKey). 4. Define the relationship in the main file to sort on the 'DynamicSortValue' field. That's it - you're in business. The gSortKey in your main file layout will operate as a menu of sort options and the portal will re-sort dynamically when you select a new option. Regards Jorgen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.