7 Replies Latest reply on Jun 5, 2017 8:52 AM by wimdecorte

    Getting 301 error


      I schedule a script. In this suddenly I m getting the error.I checked the log and its says scripting error (301) at "E_NCR : Generate TXT File and Call PHP Files : Set Field".and also In Insert from URL.Here I attched screen shot.When we get 301 scripting error??

        • 1. Re: Getting 301 error


          Record is in use by another user

          It means you are trying to modify a record that already being modified at that time by another user (or you have the same record already being edited in another window in your session).


          Handling 301 errors is at the heart of any multi-user solution: you can not assume that you will get ownership of the record you want to modify.  Use the "open record" and test for errors then branch your code according to the required busines rules:

          - you can choose to loop and wait for a bit

          - or store the ID of that record somewhere so you can retry later or report it to the user


          If it is absolutely critical that ALL records are updated at the same time, then look into the transactional model that allows you to try just that and undo everything if one or more records are locked.

          • 2. Re: Getting 301 error

            But This is schdeule script than how this thing is possible ??

            • 3. Re: Getting 301 error

              If it's a scheduled script, your options depend on what type of operation it is.


              1) If it's a daily, middle-of-the-night kind of thing, the issue is probably a user leaving a record in an editing state when they leave work at the end of the day. Fix: user training (explain the implications of leaving records locked and threaten them with severe consequences if they do it) or server timeout (e.g. log users out after 2 hours of inactivity).

              2) If it is a scheduled script run several time during the day, then look at error trapping and looping - Open Record, check for Error 301, and "try again later" in some form.




              • 4. Re: Getting 301 error

                aanshi wrote:


                But This is schdeule script than how this thing is possible ??


                A scheduled script is nothing but just another user, so it can run into any issue like a regular user.  If another user has a record open, the scheduled script will not be able to write data to it.

                2 of 2 people found this helpful
                • 5. Re: Getting 301 error

                  I just migrated to FM Pro Advanced 16 and several of my scripts that previously functioned fine are throwing 301 errors. The package is single user but does us multiple window. I modified one of the errant scripts to insure all windows were closed except the table in question but 'Set Field' continues to fire 301's. Any guidance or suggestions would be greatly appreciated.

                  • 6. Re: Getting 301 error

                    As Wim said is HAS to be possible.. you would not want a server side process to indiscriminately write data that a user has "locked" or taken possession of..


                    Database Locking: What it is, Why it Matters and What to do About it

                    • 7. Re: Getting 301 error

                      See if this helps:

                      FileMaker 16 Will Report User In Conflict | ScaleFM


                      A new window will be have just like a new user; if you lock a record in one window it will not be available to write to in another window.

                      1 of 1 people found this helpful