5 Replies Latest reply on Apr 6, 2017 11:31 AM by howardh

    Web viewer + Web Direct = record lock after close


      These files are hosted on FMS 15.01.  User clients are FMP14 or 15.


      I have a bit of UI where UserA (from FileA) is using FileMaker to log into FileB; UserA in FileA goes to a layout that has a web viewer - this web viewer points at FileB using Web Direct.  FileA and FileB are hosted on the same server (if that matters).


      The interafce is fairly simple - its a list view where UserA can make comments in the records.  My problem is that UserA is locking a record in FileB after they have closed the layout.  So if UserA doesn't happen to click into empty space to force the commit, the record stays locked.


      So UserA would initiate this layout by clicking a button in FileA; this opens a new window which goes to this particular layout.  The UI for this layout has the nav bar at the top (so this portion is local to FileA context) with a 'Done' button.  The body element is completely taken up by the Web Viewer which is showing FileB via Web Direct.  So the idea is that UserA interacts through the web viewer and then clicks 'Done' (which is NOT in the web viewer) - the Done button attempts to close the Web Direct session and closes the pop-up window.


      But my 'Done' script doesn't appear to be correctly closing the connection and the record stays locked; if UserB comes along and tries to make changes to the same records, they get an ugly error, something along these lines:  "[WebDirect-103B7] (web [fmwebdirect])" is modifying this record.  You cannot use this record until "[WebDirect-103B7] (web [fmwebdirect])" is finished."


      Screen Shot 2017-04-06 at 9.16.03 .png


      How can I properly commit the records from UserA's web direct session, and still close the window that the web viewer is in?


      I thought about providing a 'Save' button that's inside the web viewer (which just does a simple 'commit' step), but it would be nice if it could be one click ('Done' from the FileA context of this layout), instead of two ('Save' from webviewer/FileB context + 'Done' from the base layout FileA context).




        • 1. Re: Web viewer + Web Direct = record lock after close

          What problem are you trying to solve by using both WebDirect and a WebViewer to access a file on the same server as the original FileMaker Client opened file?


          That seems a needlessly complex way of accessing the other file, but perhaps you have a reason for doing so that I cannot imagine?

          • 2. Re: Web viewer + Web Direct = record lock after close

            It's done to allow flexible connections between the files without prior setup.  These files don't know anything about each other directly.  There's a central file that they all know about, though.  This allows anyone with their own version of this solution to share information with anyone else using this solution - without having to configure anything in the files themselves (i.e. external datasources).  And these connections can be made and deleted by the end users without any help from us.

            • 3. Re: Web viewer + Web Direct = record lock after close

              I agree with the save button.

              We are missing disconnect supervision, a term from telephony, when on some phone systems you could hang up and still be connected haha.


              Another option is to make a new screen and perform the update to the real table from that. using global fields. It is fast too. It can be done quickly.

              create a new table and copy the same fields that would be updated from the 'real' table.

              you will still need the save button.


              So simple and fastest for development is the save button.

              fastest on the web through the viewer and web direct is a separate table for the user which updates as a transaction. More programming involved but safer in that no record locking and faster to update especially if relationships are complex and a few tables over.


              Hopefully this helps



              1 of 1 people found this helpful
              • 4. Re: Web viewer + Web Direct = record lock after close

                Thanks Howard.


                I have put in a 'Save' button for now.  It would be nice if there were better controls over the connection, as you said.


                I also thought about trying an 'OnTimer' script to check and auto-commit things if the user hasn't made any changes.  It looks like it's compatible with Web Direct.


                This is a handy tool even in regular FileMaker systems with multiple users.  It can mean that the longest a record would be locked out would be 1-2 minutes - depending on the length of the timer, of course.

                • 5. Re: Web viewer + Web Direct = record lock after close

                  glad I could be of help.


                  I also use intimer scripts. They work well and do not seem to slow anything down. However if the person is in the middle of typing or choosing it can be frustrating (from the user side).

                  to give the user some warning you can run a timer display (countdown) so the user is aware that their time is running out.


                  but weighing it all together the save button is easiest and users are familiar with the save process.