1 2 Previous Next 16 Replies Latest reply on Sep 30, 2013 10:17 AM by philmodjunk

    Portal Filtering Problem

    bookalaka_1

      Title

      Portal Filtering Problem

      Post

           This seems straight forward what am I over looking? When my search field is empty I want all the records to show currently records only show when a search is requested?

            

           Thanks for help.

            

           IsEmpty( PhysCount::g_ItemSearch) or PhysCount::g_ItemSearch = Left (PhysCnt_Items::Item; Length (PhysCount::g_ItemSearch))

        • 1. Re: Portal Filtering Problem
          philmodjunk

               What you have should work. Is the relationship based on a cartesian join (X operator instead of =)?

               Does g_ITemSearch have global storage specified?

               Is the field truly empty or might it contain an invisible character such as a space?

          • 2. Re: Portal Filtering Problem
            bookalaka_1

                 is the X doesn't show any info with =

                 Yes the global field is specified.

                 I have cleared the field with select all.

                 Could the relationship I have with the PHY_ID be an issue? Picture attached.

            • 3. Re: Portal Filtering Problem
              bookalaka_1

                   Seems when I change the Phys_ID_pk to "X" the calculation works.  This however in not what I need.  I want records from Phys_ID number  not every occurrence. What needs to change in the relationship?

                   Thanks

              • 4. Re: Portal Filtering Problem
                philmodjunk

                     Do you see the expected set of records if you temporarily modify the relationship to be:

                     PhysCount::Phys_ID_pk = PhysCnt_Items::Phys_ID_fk

                     If all is in good shape in terms of the data in the match fields this should match the result you want to see when the global field is empty.

                     Also, is your layout based on PhysCount and the portal on PhysCnt_Items? (Have to check the obvious details too...)

                • 5. Re: Portal Filtering Problem
                  bookalaka_1

                       Nope this is perplexing.

                        

                       Scenario 1)  if I have PhysID=PhysID  , g_ItemSearch X item  and use the calculation in the  "Filter portal" in my line items portal

                       IsEmpty ( PhysCount::g_ItemSearch ) or PhysCount::g_ItemSearch = Left (PhysCnt_Items::Item; Length (PhysCount::g_ItemSearch))

                  the search works fine however when the g_itemsearch is empty no records appear.

                       Scenario 2) if PhysID X PhysID , g_ItemSearch X item  and use the calculation in the  "Filter portal" in my line items portal

                       IsEmpty ( PhysCount::g_ItemSearch ) or PhysCount::g_ItemSearch = Left (PhysCnt_Items::Item; Length (PhysCount::g_ItemSearch))

                  the search as expected portal is sorted by the searched item however all records from every PHYS_ID appear, when nothing is in the gsearchfield all records show from every PHYS_ID.

                       I of course want only the 2 records from PHYS_ID #102 for example and not the 100 others that are showing up.

                       Order seems to make no difference? What am I not seeing? This is straight forward Invoice/Lineitems scenario....

                        

                        

                        

                        

                  • 6. Re: Portal Filtering Problem
                    schamblee

                         The second part of your relationship is not need. (the and part).  The first part of the relationship will limit your records to all physId that match and the second part is including all records no matter what is in either field because of the Cartesian (x). It's still going to show all records that physid match. 

                         The first step is to get your relationship to show the records you desire.  The relationship is set to show all records that match physid.

                         The second step is to test each filter.  with the filter that you have listed above will show all records if the seachfield is empty and if not empty will show records with PhysCount::g_ItemSeach that = Left(PhysCnt_Items::Length(PhysCount::G_ItemSearch)) which is based on the relationship, so it will limith the records to Physid. 

                    • 7. Re: Portal Filtering Problem
                      philmodjunk
                           

                                The second part of your relationship is not need.

                           Well actually it is. This is a trick commonly used to get a filtered portal to update when a value in the match field specified with the X operator is also used in the portal filter expression. Normally, this keeps you from having to use Refresh WIndows  [ Flush Cached Join Results ] to get the filtered portal to update after the value in the field has been edited.

                           But if simplifying the relationship to just:

                           PhysCount::Phys_ID_pk = PhysCnt_Items::Phys_ID_fk

                           Does not show the expected records in your portal (with no filter enabled), then there is something wrong with the data in your match fields.

                      • 8. Re: Portal Filtering Problem
                        schamblee

                             I've never seen anyone use that for that reason.  My point was that it wouldn't change the data in the portal.  

                             Have you seen speed test using that method over using Refresh Windows.   It doesn't seem that it would be much faster, which I guess it would limit the found set by the first part of the relationship and Refresh Window [Flush Cached Join Results] would be over all tables and records. 

                              

                        • 9. Re: Portal Filtering Problem
                          philmodjunk

                               See this demo file: https://www.dropbox.com/s/0pm1gdqcfi2ndpv/EnhancedValueSelection.fp7

                               While I haven't done exhaustive, benchmark testing, this method does appear to refresh many layouts much more quickly for the simple reason that it only affects those parts of the layout that are based on this relationship where the Refresh/flush script step refreshes EVERY part of your layout. And I've seen layouts take several minutes to update after a refresh window [flush cached results] script step was used to refresh the layout.

                          • 10. Re: Portal Filtering Problem
                            schamblee

                                 Thanks for the demo file.  I've seen post where you said you tried not to use refresh window, but I didn't know what you used.  I just found an old post.

                                  

                                  

                                  

                            • 11. Re: Portal Filtering Problem
                              philmodjunk

                                   It's something I learned from a post by LaRetta and then A fellow forum member (Sorry, but I can't pull up your name!) and I collaborated on a new version of this demo file that eliminated the need for that script step.

                              • 12. Re: Portal Filtering Problem
                                schamblee

                                     I just took a look at your demo, nice.  Well, I'm fairly new to filemaker (little over a year) and I haven't learn all the tricks yet.  That's why I try to stay connected to the forum.  

                                      

                                      

                                • 13. Re: Portal Filtering Problem
                                  bookalaka_1

                                       Thanks everyone for the help. I believe Phil is correct and what I was afraid of somehow my ID fields because I have imported from another file may not have retained the integrity needed. I spent many hours trouble shooting and no success. Built another "Test" file and easily was able to use the formula's needed however for this Solution I'm having trouble with I will need to employ a different approach. I will ask for advice in a new post.

                                       All help very much Appreciated!

                                  • 14. Re: Portal Filtering Problem
                                    philmodjunk

                                         Instead of trying a new approach, I suggest first examining the data in your two match fields to find out why they don't match. That issue will also very likely cause major problems for any other approach that you choose to use here.

                                    1 2 Previous Next