5 Replies Latest reply on Jun 8, 2009 3:12 PM by philmodjunk

    Perform find at log in

    shakti_one

      Title

      Perform find at log in

      Post

      I have a file of media center clients that I would like to allow a user at each district we serve to log into to update names, e-mail addresses, etc.

       

      How can I have the file display the client records for a district based on the district user log in?

       

      Thanks

       

      HM

        • 1. Re: Perform find at log in
          philmodjunk
            

          If they have a unique account name you can use the function get(accountname) in a script to determine which records to pull up. The script can be set to run automatically when the file opens (See file | File Options...).

           

          Can't provide much detail without knowing more about your database.

          • 2. Re: Perform find at log in
            shakti_one
              

            Hello Phil

             

            Based on your reply the following works...

             

            If [Get (AccountName) = "Merced"]
            Perform Script ["Merced"]
            Else If [Get (AccountName) = "Atwater"]
            Perform Script ["Atwater"]
            Else
            End If

             

            Thanks



            • 3. Re: Perform find at log in
              philmodjunk
                

              It must be a small world after all! :smileywink:

               

              I recognize those location names, being just a little north of there on hwy 99. (the Mod in my forum name refers to Modesto.)

               

              I even did some filemaker work for a Media Center at the Stanislaus Office of Education many years ago so we might even have crossed paths at some point.

               

              Glad your script works. Depending on what your scripts do you may be able to simplify it and avoid referring to specific account names which will make your set up more flexible and enable you to avoid having to change your script each time you add/remove account names.

               

              Enter Find Mode[]

              Set field [table::field, get(accountname)]

              Set error capture [on]

              Perform Find []

              Set error capture [off]

               

              for example might pull up a found set of all records marked with a given account name and you wouldn't have to use a long chain of If steps in your script.

              • 4. Re: Perform find at log in
                shakti_one
                  

                Hello Phil

                 

                A small world indeed!  You probably worked with Jim Boardman, my counterpart at SCOE at that time.  I'm at Merced COE.

                 

                The scripts search for active client records for a district depending on the account name.  A way to avoid a chain of If steps is my next step, though we only have about 20 districts.  I'll try your suggested script.

                 

                Thanks

                 

                HM

                • 5. Re: Perform find at log in
                  philmodjunk
                    

                  "...though we only have about 20 districts".

                  True, but if you gain or lose a district (or its name changes), your original script requires that you open and modify the script by adding/removing/changing an If step. The approach I suggest, avoids a lot of that hassle.

                   

                  Keep in mind that what you are doing won't by itself prevent users from seeing the other records. You can you access privelges to completely block access to specified records and then your script can be used to hide the records that would otherwise show "Access Denied" or some such message.

                   

                  For more about using access privileges to block record access, see:

                  http://fmforums.com/forum/showtopic.php?tid/198109 (Courtesy of a Post by Mr. Vodka on a very similar thread.)