11 Replies Latest reply on Apr 7, 2011 11:50 AM by what?

    Problem changing log in scripts



      Problem changing log in scripts


      I am working in filemaker pro 11 advanced.  I have been using a login script set in the file options.  This has been working fine, however, when I recently tried to replace my log in script with another one (by going to file options and selecting the new script), and I try to login online, the script wont run, I just get taken to a the layout currently open.  When I switch back to my old log in script, it works fine.  This seems to be an illogical situation, which has defied any of my problem solving abilities, limited though they are.

        • 1. Re: Problem changing log in scripts

          Not much to suggest without seeing that new script you tried to use. Since you have FileMaker advanced, you might try this trick:

          Launch FileMaker without opening your file.

          Enable the script debugger

          Now use Open or Open Remote... from the file menu to open your file.

          The log in script should pop up in your script debugger where you can watch it execute step by step and that may show you why you aren't getting the results you expected here.

          • 2. Re: Problem changing log in scripts

            Thank you, I will try this.  The strange thing about this situation is that no script other than my original will run; I have tried creating a log in script that has one command; go to layout.  Even something as simple as that doesn't work.  It's as though the program is tied to the first log in script, and won't run any other on login.

            • 3. Re: Problem changing log in scripts

              What do you see when you enable the debugger and try to log in?

              • 4. Re: Problem changing log in scripts

                I tried opening the file, and there is no problem opening the script.  The problem happens when I try to log in to the already open database over either the network or the web.  When I try to do this, the new log in script doesn't work.  When i set file options to the original log in script, it still works.  This seems completely illogical to me!

                • 5. Re: Problem changing log in scripts

                  In File Options there is no setting to run a script on Login. A script can be made to run on opening and/or closing a file. This is not to say that what you want to do can't be done . . . just not in File Options. In other words, if a file is already open and you're logging in to it, the Opener script won't run. Perhaps you could write a Login type script that then launches what you're now calling your login script. Alternately you could incorporate the Login procedure into your current script and have it run on opening as well. This would be useful when you log in to the file after opening. I'm no expert at this part of FM, but I think the difference is between "Login" and "On Opening".

                  • 6. Re: Problem changing log in scripts

                    Thank you for your response.  You are saying that I cannot run a script when logging into an already open file from the network or the web, correct?

                    I am saying that I have done this very thing many times, by checking the perform script on opening option in the file options window.  The thing that I cannot do is change the login script.  When I do this, the program agrees with you and will not run the script.  Is this some kind of weird back door glitch in the program?

                     All of this notwithstanding, can you tell me more specifically how I can create log in scripts for different sets of account holders?  I am using my filemaker 11 program as a server for my students to access and edit their information, and for other controlled access groups.

                    Thank you.

                    • 7. Re: Problem changing log in scripts

                      Please describe in detail what you do to "log in" to a file that is "already open".

                      If you are connecting to a hosted file via Open Remote or with a web browser to a web published database, the script set to run "on open" should run. If you are using a script with re log in to log into the password with different password than was used to open the file in the first place, the re-login operation is not opening the file and your script won't run as far as I can tell here.

                      I still think that there are issues with your script that are keeping it from running like you expect and this is why nothing is happening when you open the file over the network or via a web browser.

                      Be advised that certain script steps are not compatible with web publishing. Freeze Window has been found to keep a script from running as has Allow Toolbars[Off], so examine your scripts for web compatibility issues and remove or disable them for testing purposes or inclose them in If blocks that keep them from executing if the current client is a web browser based user.

                      • 8. Re: Problem changing log in scripts

                        Thank you for all of your efforts, however, I have solved the problem!

                         It turns out that, when I want to change or modify my file opening script (to use it as a log in script over the internet), which, as you correctly say, would run when accessing the open file over the web, I need first to select the new or modified "log in" script in file options, then close the file (something I wasn't doing before), and finally re open the file.  Opening the file enables the "log in script" that I have set up in file options to run when accessing the file over the web.  

                        This was puzzling me for a long time.  I would try to modify an existing "log in" script that I had been using successfully, and the old steps would work, but not the new ones!  There is something in the guts of filemaker that won't regognize "open" scripts through the web, unless the file has been opened with them first.  For an amatuer like me, this was a major effort, however, I do feel a very strong sense of satisfaction having solved the problem.

                        Thanks again for your comments!

                        • 9. Re: Problem changing log in scripts

                          I stand corrected!  Apparently, my log in success was a random bit of luck.

                          I still can't get the login online to work consistently.  

                          Here is the situation:

                          I have what I call a login script selected in the file options window.  Accessing from the web, My original script works every time.

                          When I try to use a different script by selecting it in the file options window, the new script isn't recognized by filemaker, and it won't run when accessing from the web.

                          Here is the completely illogical part-----!!!!!!!  When I copy the script that works, and then select that in the file options window; it doesn't work from the web!

                          When I reselect the original script, which is an  exact copy, it works.

                          I have poured way too much time into this; thanks to anyone who can tell me what's wrong.

                          • 10. Re: Problem changing log in scripts

                            Never did post the actual scripts involved, but since an exact duplicate fails, I wonder if your file has been corrupted at some point. You might want to run a recover on it just to be sure that's not the issue.

                            Things to keep in mind about Recover:

                            1. Recover does not detect all problems
                            2. Recover doesn't always fix all problems correctly
                            3. Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.

                            • 11. Re: Problem changing log in scripts

                              This time for sure!  I tried your recovery method; no luck.  Then I thought perhaps it's something in security, so I checked all of the privileges.  It turns out that when I made a new script, I didn't go into security and allow it to run with the account I was using.  The filemaker default is to disallow any script to run when logging on, unless you specifically give permission.  I really think this is it; I can now change my scripts and have them work when I access online.

                              Thanks for helping me with this problem!