Jarvis Posted April 7, 2007 Posted April 7, 2007 I have a database that keeps track of the tasks that need to happen in my cabinetshop. Each time a task is noted, a record is created with information about the task. These tasks are prioritized with the values 1 thru 10. I would like to view these top ten priorities via a portal on another layout. As the priorities are re-arranged, I would like to see the portal information reflect the changes. I can sort the records according to priority & I can perform a find to include only records with a priority between 1 and 10 but I have not been able to make only this found set show up in the portal. I have tried a single portal with 10 rows and I have tried ten portals, each with a single row starting with intitial row of 1-2-3 etc. Any ideas how to perform a find > sort the find> display just the first 10 values of the found set? Thanks for any clues, Jarvis
Søren Dyhr Posted April 7, 2007 Posted April 7, 2007 but I have not been able to make only this found set show up in the portal if you remove the scrollbar in a 10liner.... Any ideas how to perform a find > sort the find> display just the first 10 values of the found set? To show: http://www.filemakerpros.com/GetNthRecordTAIL.zip ...and let it substitute the old "Copy All Records" method found in this video: http://www.filemakermagazine.com/secured/550/PortalResults_full.mov The sorting could follow this approach: http://www.filemakerpros.com/LessSort.zip --sd
Jarvis Posted April 7, 2007 Author Posted April 7, 2007 Soren, I want to thank you for your response. I am very appreciative that you take the time to weigh in on my posts. I have to admit, however, that I can never understand any one of your responses. Your synapses fire so fast that a lot of us (me at least) simply cannot keep up. I am a cabinetmaker, not a scientist. I am stuck on a question and would welcome an answer. Sending me out to research arcane literature is not an answer. I am sure you have a wealth of knowledge that the rest of us could benefit from if you would take a moment to develop your thought. Thanks, Jarvis
LaRetta Posted April 8, 2007 Posted April 8, 2007 (edited) This might be a bit old-school but, if you sort your portal on the priority (ascending) and possibly one other field to determine how to handle ties (such as creation date); then, as Soren suggests, a portal with only 10 rows would only display your top 10. By your description, you want the portal on a layout based upon tasks. If so, and the above works for you then join only on TaskID. But if priority is greater than 10 but there are less than 10 records, the higher priority tasks will display to fill the space. Another option is to use a calculation called cPriority (number) = 11. If your new Task TO (portal) is called Top Ten, then join as: Tasks::TaskID = TopTen::TaskID AND Tasks::cPriority > TopTen::Priority This assumes Priority is number. Then if there are only 3 Priorities in top ten, only 3 will display. Does this get you closer? UPDATE: I originally suggested calculation global for this. But I'm unsure it makes any difference. Your Prioity field must be number or the relationship will improperly filter and display only Priorities beginning with 1 (text match). If you want ALL tasks to show in the single portal, remove the TaskID from the join. To display the priority of the tasks, type the @@ symbol in the portal instead of displaying the true Priority field. Then, depending upon your sort, your priority will match the sequence order (pulling in a second sort criteria). DOUBLE-UPDATE: By refusing to hard-code the 'true' priority and letting the record number handle it (in case of ties), you will always remain in synch. It is no different than ranking; usually display is all that matters and saves from the need to set a field and reserialize them. Display only 10 rows. LaRetta :wink2: Edited April 8, 2007 by Guest
Jarvis Posted April 8, 2007 Author Posted April 8, 2007 Thank you LaRetta. I haven't got a clue what that @@ trick is all about, but it seems to work. The priorities showed right up. Thanks again, Jarvis
LaRetta Posted April 8, 2007 Posted April 8, 2007 If you select Insert from the Menu (while in layout mode), you will see at the bottom 'record number symbol.' Sorry I didn't explain that but that's all it is and it will work whether selecting it there or when typing text @@ on any main layout or in any portal. I'm glad it worked for you! :wink2:
Recommended Posts
This topic is 6439 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 accountSign in
Already have an account? Sign in here.
Sign In Now