8 Replies Latest reply on Mar 7, 2012 10:00 AM by gwbamber

    Multiple Users on single record

    FahimSurani

      Title

      Multiple Users on single record

      Post

      Hello again, 

      So I've slowly started to get the hang of FileMaker Pro but I've run into a potential issue. If I have multiple users accessing a same record, it is possible that they could overwrite or delete each other's values without noticing. Is there a method of locking a record while it's in use. Or perhaps notifying the user that more than one person is editing the record?

      I hope what I'm asking is clear. As always thanks in advance for your continued help.

      Clarification: When I use the term "record" I don't mean field. I mean the entire record. Just pointing it out because in the tutorial documentation "record" is used interchangeably to mean field and record.

        • 1. Re: Multiple Users on single record
          philmodjunk

          FileMaker automatically puts an "edit lock" on a record when the first user opens the record for editing--by putting their cursor into a field. As long as the record is not committed, it will remain locked and all other users are prevented from editing that record. Should they try to do so, they get an error message that pops up and tells them who has locked the record.

          • 2. Re: Multiple Users on single record
            FahimSurani

            Thanks for the response,

            Default behaviour for FileMaker is that when editing a record, as soon as you finish typing in a field (move to another field). It automatically commits the record. The behaviour you have described I have seen only when two users edit the same FIELD, not the same record.Perhaps I will illustrate what I mean with an example.

            Assume you have a form called Customer. In it there are 3 fields: name, number, email. Say we have already have a customer in here named Bob. If User 1 and User 2 both go to Bobs' record, User 1 can change Bob's name while User 2 changes his email. This is allowed in FileMaker. However, should User 1 and User 2 both attempt to edit Bobs' name at the same time, only then does it enforce the "edit lock" described above. This may be because by default auto commit is turned on.

            What I'd like is 2 things:
            1) When a user goes to different records they are not automatically editable. Perhaps I need a way of locking the fields down until an "edit" or "modify" button is pressed.
            2) Upon doing so, the "edit lock" is enforced on the entire record, not just 1 particular field.

            Is this possible? If so how, or where can I find the information in doing this? Or perhaps a better solution of achieving the same effect other than creating an "edit" and then "save" button

            As always, thanks for all the great help!

            • 3. Re: Multiple Users on single record
              philmodjunk

              Default behaviour for FileMaker is that when editing a record, as soon as you finish typing in a field (move to another field). It automatically commits the record.

              This is not the case. Changing fields does not commit the record. Changing records, changing layouts or clicking a blank area of the layout will commit the record, but not tabbing or clicking into another field of the same record. The exception to this is if you have a script trigger with OnObjectExit or OnObjectSave that performs a script that also commits the record.

              Edit Lock is indeed enforced on the entire record as long as you keep a cursor in one of the fields of that record.

              You can test this for yourself. Use New Window to open a second window to the same record. Put the cursor in one field in one window. Switch windows and try to edit a record. You'll get the edit lock error message just like you do when this happens with two networked users accessing the same record. Now go back to the first window, click or tab into a different window and edit some data. You will not see the data change in the other window even if you use refresh window on it as the changes have not been commited by switching fields and you'll find that your are still locked out of making changes on the second window.

              • 4. Re: Multiple Users on single record
                FahimSurani

                Ahh ok. It's clicking a blank area of the layout. Fair enough.

                Edit Lock is indeed enforced on the entire record as long as you keep a cursor in one of the fields of that record.

                You can test this for yourself. Use New Window to open a second window to the same record. Put the cursor in one field in one window. Switch windows and try to edit a record. You'll get the edit lock error message just like you do when this happens with two networked users accessing the same record. Now go back to the first window, click or tab into a different window and edit some data. You will not see the data change in the other window even if you use refresh window on it as the changes have not been commited by switching fields and you'll find that your are still locked out of making changes on the second window.

                I tried this on the Invoice sample and what I'm seeing is what I described in the OP. Where 2 users are able to concurrently edit 2 separate fields on the same record, and "Edit Lock" kicking in when they are in the same field.

                Strangely enough, I tried creating a new DB and added users with their own set of privelages instead of auto-login as admin (like in the Invoice sample) and then the behaviour you explained kicked in...

                So I suppose the edit record lock only applys when you have different user's setup? Or is there some other explanation? I would really like to avoid having this occur the next time.

                • 5. Re: Multiple Users on single record
                  philmodjunk

                  What version of Filemaker are you using? I assumed 10 or 11 where you get this locking behavior with different windows just like you do with simultaneous users. I've used this method to simulate multiple users when working with edit lock issues. Older versions, I believe, do not show this behavior when two windows are open to the same record on the same machine.

                  And you can keep a mouse click on the layout background from committing a record if you employ a little ingenuity with the design of your layout...

                  • 6. Re: Multiple Users on single record
                    FahimSurani

                    Perhaps I should have explained my test environment. The DB is hosted on FileMaker Pro 11, and the other client is FileMaker Go (whatever the latest version is). The issue can be recreated just be putting the sample Invoices db on FileMakerGo hosted by FileMaker Pro as is.

                    I could potentially play around with the layout but in a previous post you may remember that I realized that the size of the fields used in entering data VASTLY affects the performance on the iPad 2.

                    • 7. Re: Multiple Users on single record
                      philmodjunk

                      Not being a Go user, I haven't tried this in that environment.

                      • 8. Re: Multiple Users on single record
                        gwbamber

                        I'm having a problem with this too. I would like to not allow any two users into the same record at the same time. I tried this script suggested in a different thread

                        "Set Error capture [on]
                        Open Record/Request
                        If [ Get ( LastError ) > 0]
                             Show Custom Dialog ["Record is in use..."]
                        End If"

                        But it doesn't work every time. Also, i've tested the Filemaker database by opening two windows and with another user logged in and changes were able to be made with and without the record being committed. Is this due to a some sharing setting being turned on?