8 Replies Latest reply on Aug 3, 2011 12:15 PM by DianeJohnson

    Using a matchfield relationship but no portal to filter values

    FH

      Title

      Using a matchfield relationship but no portal to filter values

      Post

      does this work?

      Given is a table with records from which those shall not be visible in Layout A (table bookings), whose matchfield_visibility=1. So only a part of all records shall be shown. Currently I'm using a script with script-trigger, but this leads to problems and interferneces with other scripts, so I'd like to avoid that. Again, I can not use a portal.

      How can I set up a relation that allows filtering without a portal?

      It would be great, if the answerer could be quite detailed also about the relation of layout to table.

      Thanks a lot in advance, any hints are welcome.

        • 1. Re: Using a matchfield relationship but no portal to filter values
          Rajkumar

          write an autoscript "on record save" for the filed "matchfield_visibility", when this field is 1, then set the font color (for the field, whose text u want to hide,say A)same as the field background color.

          set field (A; TextColor(A;RGB(255;255;255));//if background of field A is white.

          Hope This will solve ur problem.

          • 2. Re: Using a matchfield relationship but no portal to filter values
            philmodjunk

            It would be great, if the answerer could be quite detailed also about the relation of layout to table.

            Tutorial: What are Table Occurrences?

            Currently I'm using a script with script-trigger, but this leads to problems and interferneces with other scripts

            Just to let you know, there are several ways to prevent such interference.

            With regards to your main question. I really can't answer from the information you've given. We'd need to know in more detail exactly what, from the user's perspective, you are trying to do here.

            • 3. Re: Using a matchfield relationship but no portal to filter values
              FH

              @Raj

              Thanks for your comment, but this is not the approach that I'm looking for

              @PhilModJunk

              I do have a table called "budget" and a layout "budget". There is a field called "projection" which for each record that is a real income is set to 0 and for each record that is just projected income is set to 1. I'd like to have two layouts that refer to the same table (still it could be table occurrences), one layout should show the real income, the other just the projected income.Another, third layout is used for sorting the results according to a headline, so I'm able to show the projected income against the real income within one layout and without a portal (which would have only limited rows).

              So for the first two layouts at the moment a script trigger using a search filters out the projected or real income. I'd like to use a relation with another table to achieve this, if this is possible at all, circumventing the script and the use of a portal.

              I hope this descriptions is more clear. Thanks a lot in advance.

              • 4. Re: Using a matchfield relationship but no portal to filter values
                philmodjunk

                Using a script trigger based find to filter out the undesired records would seem the best approach here. Using a relationship would only result in either performing what is essentially a different kind of find using Go To Related record that would need the same type of script trigger or you'd need to use a portal to view your records -- which you've indicated that you don't want here.

                What issues are you having with your script trigger? Maybe we can fine tune that approach to make it run smoother.

                • 5. Re: Using a matchfield relationship but no portal to filter values
                  FH

                  The script trigger performs a search on load of the layout and results in only those records that have income set to 0. If the user performs his/her own search on whatever field, it finds all appearances and doesn't exclude the field that have income set to 0.

                  • 6. Re: Using a matchfield relationship but no portal to filter values
                    philmodjunk

                    Use a version of this script to use Constrain Found Set instead of Perform Find and set it to run OnModeEnter [Browse]. If I read the descriptions correctly, this script will then automatically filter the User's found set to filter out the records with nonzero income after they perform a find.

                    It might also be possible to use Manage | Security to set up a record level access expression that restricts the users ability to view records with a specific value for a given layout. That setting should automatically filter out the records you don't want the user to see for that layout.

                    Using Filemaker Advanced, you can also modify the options in the records menu to either eliminate them or to replace the standard operations with scripts that modify the results to exclude undesired records.

                    • 7. Re: Using a matchfield relationship but no portal to filter values
                      FH

                      The first options seams the most feasible for me.

                      The second (Manage/Security) sounded good, but it is only possible to restrict access per table (not per table occurrence that could be mapped onto a layout) or to a layout in general which would help in this situation.

                      The third option is a great hint to further deepen the scripted approach and I'll use this to catch for instance calls for Apfel+J

                      Thanks a lot for your answer!

                      • 8. Re: Using a matchfield relationship but no portal to filter values
                        DianeJohnson

                        Interesting....

                        I ran into the same desire of wanting to use a table relationship to filter records instead of using a portal. I guess I am confused as to why one can create a value list based on a relationship that limits the values in that list to those that meet the relationship criteria, but you can't actually limit the records visible in a table based on a relationship. This all to eliminate the need to script a Find step.