5 Replies Latest reply on Oct 4, 2013 4:18 PM by philmodjunk

    Portal

    DranLang

      Title

      Portal

      Post

           Hi everyone!  Is it possible to search data range in a portal?  I have a project from my boss coming from another department to come up with a way to search records, all the records that they wanted to search are in a portal.  I already have a script that searches for a range of dates but if I use it to search a range of dates that are in a portal it won't display the result in a portal, the portal still shows the entire content of the portal.  How can I make this to run properly?  Here's the script I wrote:

           If[<Condition>]

           Go to Layout[<LayoutName>]

           Enter Find Mode []

           Set Field {<Condition>]

           Perform Find []

           Sort Records[Restore; No dialog]

           End If

            

           Is there something I need to add or what do I need to change?  Thank you and any idea/ help is deeply appreciated!

        • 1. Re: Portal
          philmodjunk

               Neither a scripted nor a manual find will have any effect on what records appear in a portal. That is controlled by the portal filter and the portal's underlying relationship.

               When a find is performed and criteria specified for a field in a related table, you are telling FileMaker: "Find all records in the layout's table that have at least one related record matching that criteria". And once the records are found for the layout's table, all related data is displayed in the portal as it always is displayed.

               To suggest a way to get way to get what you want requires a clearer understanding of what exactly you want to get. Since you have records in at least two tables when you have a portal, are you searching for a set of records in the portal's table or in the layouts?

          • 2. Re: Portal
            DranLang

                 Initially I was doing a search in a layout where the portal is, but that didn't work.  So now I'm just using the layout where the portal shows all the related records but it will show the search result (Found Set) in the table where the records are actually located (I just made a layout switch).  But if there are other ways to do it with out going into the table it self, it would be more favorable.

            • 3. Re: Portal
              philmodjunk

                   Let me try that again.

                   For your portal, you have two tables in a relationship:

                   Table1-----<Table2

                   Your layout specifies Table1, your portal specifies Table2.

                   When you perform your find, do you want to find records in Table 1 or in table 2? Or do you want to find all records in Table1 that have at least one related record in table 2 that matches the criteria, but only want to display the related records that match that criteria in the portal?

              • 4. Re: Portal
                DranLang

                     It's the last one that I think my boss wants to happen.

                • 5. Re: Portal
                  philmodjunk

                       That's most easily done without using a portal on your layout. If you perform the find on Table 2, You can set up a list view layout, sort your records to group them by related Table 1 record and use a sub summary layout part as a sub header for data from each related record in Table 1. The result is much like a set of records with portals but much easier to set up and works with nearly any find criteria that you specify.

                       If you have to use actual portals, you then have to include date in match fields or fields used in a portal filter expression to eliminate the portal records that do not match the specified criteria. If you are performing finds with a lot of different types of criteria, that can be difficult to implement. If your criteria is of the same basic type each time (such as always specifying a date range for records in the portal), then it's not terribly difficult to come up with either a filter or some match fields.