1 2 3 Previous Next 35 Replies Latest reply on Nov 13, 2009 12:38 PM by TSGal

    While in manage database the script step for new record does not work

    caryn312

      Summary

      While in manage database the script step for new record does not work

      Description of the issue

      Here is what happened, and I found out the hard way.  I had the manage database part of Filemaker  Advanced 10 v3 open, and scripts that users were running did not allow the "new record" step to work.  As a consequence, instead of creating a new record in the database that I was working in, the data was over-written.  I have since added some error handling to prevent this from happening again, but now I am spooked about entering the "Manage Database" area while users are working.  I need advice on how I can do development work while users are working, assuming it is possible.

        • 1. Re: While in manage database the script step for new record does not work
          TSGal

          caryn312:

           

          Thank you for your post.

           

          Myself, when I need to make changes to a working database file, I have a copy of the file on my local machine.  Once I make the changes, I ask everyone to stop for a few minutes (or schedule a time for the update).  That way, I can make a copy of the file, import the data from the server, and then replace the old file with the new file.  I realize this may not be possible for you, and updating the database quickly is a consideration.  Still, you may want to schedule a time for "maintenance" or ask users to stop access for a few minutes while you make changes.

           

          Does anyone else have suggestions?

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: While in manage database the script step for new record does not work
            philmodjunk
              

            More importantly, can you confirm this issue?

             

            I frequently make small changes to our running database, though usually not via Manage | Database on our XP/windows server based systems and am wondering if I've just been lucky or if this issue doesn't apply to the OS options we are using.

             

            In general, it would seem that making changes to a "live" database will always have some degree of risk--it's kind of like repairing a car while it's being driven down the freeway and your users are behind the wheel trying to see past the mechanic perched on the hood :smileysurprised:. 

             

            Layout changes seem fairly safe.

            Simple script changes are more risky, but if you don't save your changes until all the script fixes have been made you can get away with it.

            Changes to field definitions and relationships can result in fundamental and wide-ranging changes to your system's behavior and should be avoided on "live" systems if at all possible.

             

            On the other hand, I've chosen to add a new field to a table once or twice--which seemed to be pretty safe until I read this post. :smileymad:

            • 3. Re: While in manage database the script step for new record does not work
              TSGal

              PhilModJunk:

               

              No, I haven't been able to confirm it, but I haven't finished testing different scenarios.  In any case, whenever changes are made to the structure/schema of a file, I would recommend prohibiting external user access to reduce the possibility of corruption.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: While in manage database the script step for new record does not work
                philmodjunk
                  

                I agree, and on futher reflection, I can imagine that Filemaker probably locks tables and/or records for a brief time after you click OK to dismiss Manage | Database if you've made any changes.

                 

                Any scripts that attempt to modify data or create/delete a record could be locked out in that interval.

                • 5. Re: While in manage database the script step for new record does not work
                  caryn
                    

                  Thank you for your quick response, but don't you think that Filemaker should make it clear about the consequences of allowing development while users are in the system?  In my experience with Filemaker before v7, you were not able to create or modify definitions while users were in the file, but now you can, and Filemaker does not make it clear about the risks.  I still don't know if it means that while the manager is open on anything (relationships, for instance), whether it will present this same problem.

                   

                  I can't use you suggestion about importing data into a local copy, since most of our files are very large, and importing can take hours:  that is why I thought this version of Filemaker had a clear advantage allowing for development on a live system!

                   

                  I would appreciate any suggestions about this from other users or Filemaker personnel.

                  • 6. Re: While in manage database the script step for new record does not work
                    WoodApple
                       It has been my experience (since ver 3) that this has always been the case. I fequently do updates to a live system and am all too aware of this. I guess I have taken it for granted that this is normal behavior. Inversely, A user in a non-committed record will lock a developer from saving changes done at the table/relationship level. Editing scripts does not suffer this same effect.
                    • 7. Re: While in manage database the script step for new record does not work
                      caryn
                         The difference between the earlier versions and the later versions is that now a developer can enter the area to edit and change fields whereas before you could not.  If making any changes or just having the database manager open can cause scripts not to work correctly, then Filemaker needs to make it clear as to what functions can be done safely when users are in the file you are working on.
                      • 8. Re: While in manage database the script step for new record does not work
                        philmodjunk
                          

                        "...but don't you think that Filemaker should make it clear about the consequences of allowing development while users are in the system?" 

                         

                        I strongly agree, but in reality, Filemaker allows the unwary to run off cliffs in any number of areas. Scripts fail to work without displaying messages to the user/developer when an error occurs in many situations. Go To Related Record can catastrophically alter massive numbers of records when there is no related record to go to in certain circumstances. Adding a field can misalign Import Record steps in scripts... just too name a few.

                         

                        "I still don't know if it means that while the manager is open on anything (relationships, for instance), whether it will present this same problem."

                         

                        In my experience, simply opening Manage | Database ( to double check relationships for an example) does not lock out any database functions. I've done that any number of times with no user complaints. (and there's a script they run that starts a new invoice record that they trigger constantly during business hours).

                         

                        I can't use you suggestion about importing data into a local copy, since most of our files are very large, and importing can take hours:  that is why I thought this version of Filemaker had a clear advantage allowing for development on a live system!

                         

                        I hear you, several my DB's exceed 2 GB and hold Millions of records. The new version allows me to make schema level changes after regular business hours without taking the DB down off the server and this is a huge improvement over older versions.

                         

                        However, sometimes there is just no substitute for developing and testing changes in a clone of the current file and then importing all the data from the current file into the clone. This can take many hours to do. Sometimes, I set up a script that imports records for each table in the file. Then, after regular business hours, I take a copy of the current file and kick off the import script. I check on the file early the next morning and if all looks good, I swap in the new file, keeping the old file close so that I can swap it back in a hurry if a problem is uncovered in the updated file.

                         

                         

                        • 9. Re: While in manage database the script step for new record does not work
                          WoodApple
                            

                          caryn wrote:
                          The difference between the earlier versions and the later versions is that now a developer can enter the area to edit and change fields whereas before you could not. 

                          As far as I know this has always been possible (although filemaker never recommended it, it required a full access privilege set be used for opening the hosted file and we as developers were discouraged from allowing them to be used in hosted files for security reasons.)

                           


                          caryn wrote:
                          ...Filemaker needs to make it clear as to what functions can be done safely when users are in the file you are working on.

                           

                          "safely" is a relative term. I would say there will always be a chance of something going wrong if you make changes to live files. Based on how a file is being used, how often data is changing, etc. the risk will change. I have learned for experience. Some files I do not hesitate to change (static data that rarely changes) and some files that I wait for a time I can at least be the only user in the file (data changing a once a min or more.) The longer you have the field definitions open, the more likely for it to cause a problem.

                          • 10. Re: While in manage database the script step for new record does not work
                            TSGal

                            All:

                             

                            I have run through several tests, and I'm unable to replicate the problem.  Besides adding records as the structure was being modified (adding fields, changing field names, even deleting fields), I did not have any previous records overwritten.

                             

                            If you can replicate the problem, please provide the steps.  This way, I can get the information to our Development and Software Quality Assurance (Testing) departments to review and verify so it can be changed.  If you cannot replicate the problem, please try to remember what steps you took when the client reported the problem.

                             

                            In the mean time, I would still recommend asking others to not use the database while you access Manage -> Database...

                             

                            TSGal

                            FileMaker, Inc. 

                            • 11. Re: While in manage database the script step for new record does not work
                              caryn312
                                 I believe I did "replicate" the problem in some respect.  Here's what I did:  Just after the "new record" step, I added error handling which queried the error captured after the new record step... using "if get(error) > 0." Just 2 days ago, a user called me while I had the database open in the database manager to tell me that she got the error message that I created after that error capture.  My error handling displayed the message to the user and halted the scripts.  The point is that I was not even in the process of saving changes.  I was looking something up to see what I might change when I got the call from the user.  I think you should be able to test this yourself, by creating a script that creates a record and capturing the error while the database manager is open.
                              • 12. Re: While in manage database the script step for new record does not work
                                TSGal

                                caryn312:

                                 

                                Thanks for the additional information, but my script was already very similar to yours.

                                 

                                Set Error Capture [ On ]

                                New Record/Request

                                If [ Get ( LastError ) > 0 ]

                                   Set Variable [ $var ; Get ( LastError ) ]

                                   Set Field [ Name ; $var ]

                                End If

                                 

                                -----

                                 

                                I then placed a button on the layout executing this script.

                                 

                                With four other machines accessing the file, I enter "Manage -> Database...", add fields, subtract fields, and I see the record counter incrementing as these changes are made.  Nobody ever received a value in the "Name" field.

                                 

                                For some of the time, the host computer was running under Mac OS X 10.5.8, and the rest of the time was running under Windows XP SP3.  This was done to rule out if the error was OS related.

                                 

                                The client machines were Windows Vista, Windows XP, Mac OS X 10.5.8, and two machines running Mac OS X 10.6.1.

                                 

                                If there is anything else you want me to try, please let me know.

                                 

                                TSGal

                                FileMaker, Inc. 

                                • 13. Re: While in manage database the script step for new record does not work
                                  caryn312
                                     How about running that new record script from another file to see if you get the same results.  In our case, the user is starting from File A and adding a record in File B.  See if that makes a difference.  In the case where I uncovered the error, I just left the manage database window open to fields.  If you can't easily try this, I will try to set something up on our server to do that.
                                  • 14. Re: While in manage database the script step for new record does not work
                                    TSGal

                                    caryn312:

                                     

                                    Thanks for the additional information.

                                     

                                    I have a script in File A that executes a script in File B to add a record.

                                     

                                    File A "Add a Remote Record" script:

                                     

                                    Perform Script [ "Add Record" from file: "File B"; Parameter: File A::ID ]

                                     

                                     

                                    File B "Add Record" script:

                                     

                                    Set Variable [ $ID ; Value: Get ( ScriptParameter ) ]

                                    New Record/Request

                                    Set Field [ File B::ID ; $ID ]

                                     

                                    To better duplicate your problem, I wanted to make sure records were added and data was entered.

                                     

                                    In File A layout, I created a rectangle button to execute Script A "Add a Remote Record".  This works locally and remotely.

                                     

                                    On the host machine, I accessed "Manage -> Database..." for File B and clicked the "Fields" tab.  As I was adding/editing/deleting fields, I asked remote users to click different records a specified number of times.  The number of records increased by the set number, so the remote script to add records worked correctly. 

                                     

                                    Is there anything else you would like me to try?

                                     

                                    TSGal

                                    FileMaker, Inc. 

                                    1 2 3 Previous Next