7 Replies Latest reply on Jun 20, 2012 3:34 PM by philmodjunk

    Restrict records per layout

    mk4482

      Title

      Restrict records per layout

      Post

      I am using FMP 11 on a FMP 11 Advanced Server and I have set up a layout called Library in which I only want to show records whose department name is Library.  That works fine when I first open the layout, but if I do a find for one record, I cannot figure out how to come back to just the Library records.  In other words, I want the Library users to only be able to see the Library records and not be able to see or get to the rest of the records in the database.  So when the Library layout is opened, I don't want it to show just the filter of Library records (400 out of 3500), I want it to show ONLY the 400.  I am not sure how to do this.  I hope it makes sense, but if not, let me know if you need more information.

        • 1. Re: Restrict records per layout
          VeronicaChavez_1

          Pretty sure you have an On Layout Enter script on that layout so that it only shows those those 400 when you enter correct?

          You can create a script (runs on commit or on exit find mode or something of that sort) that will go to a fake layout and return to the Library layout (hence will re-enter the layout invisibly, reloading only the 400 records with the library department.  

          • 2. Re: Restrict records per layout
            philmodjunk

            You can also use an OnModeExit trigger to perform a script when the user exits Find mode (such as when they perform their own find). This trigger can perform a script that uses ConstrainFound set to filter out any records their find pulled up that aren't of the specified department.

            If you have FileMaker Advanced, you can set up a custom menu set where steps such as Show All Records and Show Omitted Only either are disabled, do not exist in the menu, or that perform scripts of your design that actually find all records in the designated department or that show all omitted records, then use constrain found set to filter out the ones that shouldn't be there. The custom menus will also work from keyboard shortcuts so if you get all of this in place, the user need never know that there are any records there except those with "library" in the department field.

            • 3. Re: Restrict records per layout

              Since the library layout is just for library records and you will have buttons on it to do things like find, list and so on, dedicate those buttons to just locating library records.

              You can reduce the records after a find by using

              Constrain (field = "library")

              or including it in your find script

              Enter Find Mode
              Set Field x to y
              Set field xxx to "Library"
              Perform Find

              Thus you do a two field fiind where x must = y and field xxx must = library

              Easiest is to write a script that fiinds exactly the records you want, the 400, and perform that script with a button on the layout or at the end of any script to take you to the library layout and list 400 records. 

              • 4. Re: Restrict records per layout
                mk4482

                Creating a custom menu set worked perfectly!  Well almost.  I have the Show All button running a script that only pulls the Library records - excellent! - but it doesn't work in the web version of Filemaker.  Is there any way to get that to do the same thing?

                • 5. Re: Restrict records per layout
                  philmodjunk

                  I'd expect that script to work with IWP also. What Script steps did you use? Did you check the steps for web compatibility?

                  • 6. Re: Restrict records per layout
                    mk4482

                    These are the script steps I am using - and this script also runs when a Library user logs in because it is attached to the Library layout (OnLayoutEnter).

                    Perform Find [Restore] - this locates all records whose department name is Library.

                    Sort Records [Restore: No dialogue] - this sorts by equipment ID#.

                    Go to Record/Request/Page [First]

                    These steps are all compatible with Web Publishing.

                    Also, in the client software version, the green button that shows how many records were found is dimmed out (which is what I want), but the web version allows that to be selected.  I am not sure if this helps you or not.  So I know I am doing something incorrectly but I certainly cannot figure out what.

                    Thanks for any additional assistance!

                    • 7. Re: Restrict records per layout
                      philmodjunk

                      Script triggers cannot be tripped by direct user action in IWP. Thus, your OnLayoutEnter trigger is not tripped when the user accesses the layout--unless a script does a go to layout to enter the layout.

                      The same is true for any other script triggers you have.