6 Replies Latest reply on Aug 12, 2017 11:53 AM by jbrown

    Card - Record Selector from Current Set

    mercator

      I have a relation with some hundred records that I allow the user to query and sort through buttons. At the end, there are typically between 50 and 120 records in the constrained set. I would like a card window that shows the users one field per record (title) of this user-constrained set (not all records) for the user to choose from. If the user clicks on one the record, the card closes and goes to this record in the original window (keeping the current set and sort order).

      I am aware I can do this with a card using the current relation in List View. However, I would like to do this with a portal (it looks nicer) but how do I set up a portal that keeps the current sort order and selection?

        • 1. Re: Card - Record Selector from Current Set
          jbrown

          Hello.

           

          The found set would have to be set up thru something like this:

          1. Create a field with global storage, a global field, called "ListIDs", and place it in whatever table you want (I ususally put global fields in their own table). This field will hold a list of the primary keys of the found (and sorted) set of records.

           

          1.5 Create a relationship between this global field and the field from which the data actual data comes:

          zSystem::ListIDs_g = YourTable::PrimaryKeyField

                    *What we're doing is leveraging the concept of multi-key relationships. That is, a list of IDs in a field will relate to all the matching IDs in the child table.

           

          2. Create your portal on a layout where the global field is. This portal will show the records from the multi-key.

          3. Back on your table where the found set will be, allow the user to find and sort the records in your script.

          THEN, in the same script.

          4. Loop through all the records and grab the ID. This can be done with a simple loop or it can be done using a cool subscript called  Hyperlist

           

          5. once you've gotten all the ids, set this list of them into that global field.

          6. Open the card window.

           

          The multi-key will show all the records with a primary key in the list in that global field. If the global field contains the list:

          1

          3

          4

          5

          then records with primary key 1, 3 ,4 ,5 will show up in the portal.

           

           

          I'm curious about your thought that portals look better. I actually do not use portals where I can and instead use list views. Lists are easier to work with and they can be sorted easier and I have complete control over them. Portals are a bit dated looking, actually in my opinion. I use them but I try my hardest to make them look like lists instead of portals.

           

          Feel free to ask any clarifying questions in further posts. I may not have given you everything you need, and without example, some of that above may be confusing. I'll try to put together a small demo.

           

          jb

          2 of 2 people found this helpful
          • 2. Re: Card - Record Selector from Current Set
            philmodjunk

            A few comments on that:

            it's not the only way to get such a list into a portal. A portal filter working from search criteria can be used to produce such a list. There are pros and cons to either approach.

             

            You don't have to loop through a found set to build a list of IDS. You can use a summary field to get such a list without the loop.

             

            For working examples of such a filtered portal approach, use the magnifying glass tool to search for Adventures in FileMaking #2.

            • 3. Re: Card - Record Selector from Current Set
              jbrown

              A few comments on that:

              No where in my post did i say it was the only way. I simply picked a way and tried to be helpful by making sure the OP understood the concept well.  However, to make sure I'm super-clear, I'll write "This is one of many ways. . ." at the top of my post.

               

              When i was a teacher, I never presented ALL the ways one can divide to my 5th graders; i chose one and then expanded to other ways (there are multiple ways to divide, just like there are multiple ways to get data from a found set and show in a portal)

               

              I think we can be the most helpful by presenting one or two options initially and then expanding from there.

              • 4. Re: Card - Record Selector from Current Set
                philmodjunk

                In the first line of your reply:

                 

                The found set would have to be set up thru something like this:

                 

                I read that as saying "this is the only way to do this". Apologies if that's not what you meant, but it's what I read in your post.

                 

                And the method that you recommended might be much more complicated and slower than is needed for the current issue. Even if you don't go into it, it's helpful to make clear that other options exist. Note that I mentioned an option and pointed out a way to learn more but refrained from going into detail about it. This leaves it up to the reader to pursue or not at their option.

                • 5. Re: Card - Record Selector from Current Set
                  mercator

                  Hi JB,

                  Thanks for your extensive answer. This worked! Thanks a lot for your help!

                  Best,

                  Mercator

                  • 6. Re: Card - Record Selector from Current Set
                    jbrown

                    Glad it worked for you.

                     

                    To Phil's excellent point there are other ways to collect data from a found set, which is what you're doing here. Feel free to explore other methods and choose what is good for your circumstance.

                     

                    My DevCon session was about this same concept, and this exact use case was part of my demo, showing off some ways to get the data

                     

                    Jeremy

                     

                    Get Outlook for iOS<https://aka.ms/o0ukef>