1 Reply Latest reply on Nov 18, 2013 4:56 PM by erolst

    finding and sorting portal


      Hi everyone



      I am using FM 12 Pro Adv on a Mac, and I am a novice with a 'mind set' that belongs to another industry totally foreign to data bases and I need help.



      I have a data base file of people's names (first name, last name etc) and have another file which has a portal.



      What I want to do is have the names show up in the portal where the names have been found and sorted alphabetically on the last name initial.



      In the data base with all the people's names, I have set up buttons marked 'A', 'B', 'C' etc with scripts that find and sort accordingly. I just do not know how to get the names to show up in the portal in the other file.



      Any help is much appreciated.




        • 1. Re: finding and sorting portal

          Finding records in one table and showing them in a portal in another are two processes that don't have a direct relationship to each other.


          The easiest way to show people from A in a portal in B would be to create a cartesian relationship between those tables, put a portal based on that relationship on your layout and filter the portal. But depending on the number of People records, that might be not the best way performance-wise.


          Another possibility is to

          • create a global text field in your other table, like gNameFilter

          • create a calculation field in your people table, say "cFirstLettername", result text, indexed, formula = Left ( nameLast ; 1 )

          • define a relationship between table A and B, where the gNameFilter = cFirstLettername


          Put a portal on your layout based on that relationship, sort it by nameLast, nameFirst, and use your script to set the desired letter into the global. (Do not write 26 scripts – write one script and pass a script parameter! Or create a related Letters table).


          Here's a sample file that may be help you.