13 Replies Latest reply on Oct 8, 2010 1:50 PM by philmodjunk

    Find command within a portal



      Find command within a portal


      I would like to do a find command within a portal that holds half a dozen registrations options.  I have done finds for folks attending different things using == in my find command, but it will also bring up other things that they have registered for.

      I am being asked to do a find for ONLY a particular registration.  NOTHING ELSE.  Help is needed from you folks with a wealth of knowledge that I do not have.

      I am about beginnier/intermediate.  Can figure some things out, but need simplistic, line for line, help. 

      Anyone out there willing?  Or can it even be done?

        • 1. Re: Find command within a portal

          What's important here, is to understand what you are really asking FileMaker to do when you enter find criteria into the fields of a related record such as those listed in a portal.

          When you place a portal on a layout, you have at least two tables involved: The parent table, specified by its table occurrence name listed in Show Records From in Layout setup... and the related child table, specified by its table occurrence name in Portal Setup... (Table occurrences are the "boxes" found in Manage | Database | Relationships.)

          When you specify find criteria in the portal row, you are telling FileMaker "find all Parent records that have at least one Child record matching this criteria". Once the find is performed and these Parent records are pulled up in the Parent Table Occurrence's found set, all related portal records will be shown, not just those that matched your find criteria.

          If you only want to see the matching records listed in the portal, you will need to either switch to a layout based on the portal records, perform your find and display your results on this layout (This layout can still display data from the parent record), or you will need to use a a filtering technique that filters the portal records according to your specified criteria. Portal filtering is fairly easy to set up in FileMaker 11, but is also possible, with some limitations, in older versions of FileMaker.

          • 2. Re: Find command within a portal

            thanks PhilModJunk.  You have been really helpful.  I have FM11, and have never used 'filter' before and it sounds like it may be simpliar than making a new layout. 

            Could you?  Would you? guide me in how to filer?



            • 3. Re: Find command within a portal

              In portal setup... of FilMaker 11, there's an option titled "Filter Portal Records" you can click this option and enter an expression that limits the records shown in the portal to only those records for which the expression is true.

              Not knowing exactly what fields you have in your portal, I can only give you a basic description of the method which you will then need to adapt to your specific database.

              Let's assume you have a value list formatted portal field that identify's registration type. Define a global text field, gSelectedRegType, add it to your layout and format it to use exactly the same value list.

              Enter this expression as your portal filter:

              ParentTable::gSelectedRegType = PortalTable::RegType

              Now, only portal records that have text in RegType that is exactly the same as the text you entered/selected in gSelectedRegType.

              We still have one issue to resolve. When you enter or select a new value in the global field, the portal will not automatically refresh with the new filter value to show you the selected registration type records.

              Write this script:

              Refresh Window [Flush cached join results]

              And set a script trigger on the global field such as OnObjectSave or OnObjectModify to run this script everytime you select or enter a new value.

              • 4. Re: Find command within a portal

                I do not have a value list formated portal field, I do have a table with the registration type + cost. name of that table is Conference Type.  (Am I confusing the terminology?)

                The field 'description' from the table 'conference type' is an index & Lookup.  It starts in the 'Conference type' table and grabs (I assume) info from the related table 'registration data'

                Do I need to make the new field 'g......' in the 'conference type' table?  Is the portal table then 'registration data'?

                You stated to add this field to my laout and format it to use exactly the same value list.  does that field then go in the portal?  Or am I making a new portal?

                Thank you for all you help.  I am learning as I go, no classes, just some 'logic'? :-)

                I was just given this project and no 'support' available, so it is a tad slow going.  :-)

                • 5. Re: Find command within a portal

                  A value list is not required, it just reduces data-entry errors in the above example.

                  A global field can be defined in any table as long as it is not going to be used in a relationship. To define a global field, add a new field in Manage | Database | Fields and then click the options button. Now click the storage tab and select global storage for this new field. (The g at the beginning is just a useful naming convention so you can tell the field is a global field when you see it on a layout or elsewhere in your system.) In this case, the field does not even have to be a global field, but it's usually a good idea, especially if you have more than one person accessing the database at a time as a global field will allow multiple uses to specify completely different filter values.

                  Given your newbie status, let's take the next step in very specific detail. So that I can do so, please give a detailed example of the type of find or filtering you'd like to see take place with this portal. Name the actual fields so that I can then use the actual fields in my instructions.

                  • 6. Re: Find command within a portal

                    Below you will find a pic of the screen that has my portal with a few of the registration 'choices'

                    Example that I would like to be able to do is find all the registrants that ONLY registered for Preconference 4, not like below where there are a mirad of things the registrant has chosen

                    Above is the table that is linked to the portal 'November 2010 conference Type' with some of the choices I get from the portal.

                    At this point, 'top pic' i do a find choose from the drop down and add == in front of that perform find. 

                    The 'boss' now wants to know who is ONLY attending PRE conference (there are 4) nothing else.

                    I hope you can help.  You made my day with the saving PDF locally! I am beginning to 'understand' a bit better.  :-)

                    • 7. Re: Find command within a portal

                      It's actually simpler to perform the find on a layout directly based on your portal table. This layout can list the specified portal records with fields from both the portal table and the related table where you are recording the rest of your registrant info that you need for this. Otherwise you have to script a system where you use the criteria both for a find (to find the parent records) and for a filter on the portal (to show only the matching portal records

                      Try this:

                      Create a list view layout and place the fields from the portal table into the body of this layout. Add fields such as the above type of registrant check box field to the body as well. Perform your find on this layout and you'll get a list of registrants how have a matching portal record without all the extras.

                      If you really truly want to use the other approach, let me know and I'll take a swing at it.

                      • 8. Re: Find command within a portal

                        Shucks!  It didn't work.

                        I did as you stated above

                        I did an == search for preconference 1 there were 39

                        I went through each registration and counted the number attending ONLY for that conference, non of the others, there were 18.

                        I went to the new layout, did a find, preconference 1 and it showed 39 not 18.  :-(

                        I used the fields from the table used in the portal.

                        • 9. Re: Find command within a portal

                          You'll need to also specify criteria in the parent table to find portal records that are only related to the specified conference.

                          • 10. Re: Find command within a portal

                            I ended up making another 'choice' of registrant in my value list of pre conferance only.  Went through the 184 rechecked all those from attendee to pre conference only, did a find, and it is all good now.  I would still like to figure out the above.  Soon.  (giggles)  Hope you will be around to help again as I am sure I will need some.  :-)

                            • 11. Re: Find command within a portal

                              how does one make 'criteria' in the parent table when the layout is using the portal table?

                              • 12. Re: Find command within a portal

                                Example of relationship status:

                                My 'parent' is Demographic data, the realtionship is RSVPID for the registration data.  (I add a new table every year as we want to be able to access the previous years numbers)  Conference type is the table I use to put in that years info;  Cost Description etc.  When I make name tags I have a description for the layout with color to decern who is what and for how long.  I also have a building table and a zip code table.  Will soon add a school district to AEA table so it auto puts in the AEA associated with the school district.

                                When I made the list view layout, the fields came from the registration data table, as that is the table I use in the portal.  Do I need to add a field in the parent table?  The Parent table never changes unless we add a new registrant, but the others change every year, or I should say, a new table with the same name followed by a different year.

                                Mind you, I have built this without really knowing what I am doing, so it may be a tad convaluded, but works most of the time.  Just this year they want new criteria and ... I am so lost.  :-(

                                • 13. Re: Find command within a portal

                                  how does one make 'criteria' in the parent table when the layout is using the portal table?

                                  Given that the tables are related, for manual finds, you can simply place fields from the related table on your layout, enter find mode and type in the criteria. For scripts you can just enter find mode and use set field steps to enter criteria in fields from the related table.