1 of 1 people found this helpful
I don't think you're on the right track.
There's no way for developers to access the cache. And FileMaker Pro doesn't "know" the connection's been dropped until it tries to communicate with the Server, such as in a commit (or script, etc).
If FM Pro is sitting idle, you can turning the network off and turn it back on and the connection might not drop. I'm not sure how long the delay is, how long it is until FMP "polls" the Server, but I'm guessing 20 seconds - 2 minutes. There's no way for FMP to passively know that connection has dropped.
However, you can commit data often using script triggers, or possibly "poll" the connection using an OnTimer script (which comes with its own problems).
1 of 1 people found this helpful
Generally speaking, Filemaker does not like being disconnected. If your having issues like this, it could very well lead to database corruption. Your best bet is to find out why the connection is dropping. If you can't get a reliable connection, I would suggest using local tables and some type of synchronization program/process to minimize the effect of connection drops. This used to be almost a guarantee of a corrupted database, but the last few releases of Filemaker since version 7 have become more tolerant. But it's still not good to tempt fate.
Maybe a less-scripting solution could be found if you use vnc / remote, screen sharing on a client within the connected VPN network. In that case you won't be able to enter data if a connection is dropped, and filemaker will not be disconnected.
You could script-trigger OnObjectExit, or -modify, -validate, or -leave to commit the field.
If you don't have performance problems you can use onObjectKeyStroke or onLayoutKeystroke. Your won't have any missing data, but there is a risk that a field could end up with just a part of the intentionally entered data.
Life is all about choices isn't it?
I'm dealing with a very similar issue right now the only difference being the connection is directly through FileMaker Networking, not a VPN. Users (primarily one I believe) have been walking away and leaving the database open on their computer and when they come back they find the connection was broken and the data they had entered has been lost. My resolution (hopefully) has been to add a custom menu item under File for "Save." I've also added the keyboard shortcut of ctrl + S to activate this item. All it does is commit the record. Although I've never run into this being an issue before I may start adding a "Save" menu item to all the databases I work on. It requires less effort and maintenance than script triggers, and I think most folks understand that if you don't save your data you run the risk of loosing it.
Of course adding the custom menu item requires FM Pro Advanced. But if you think this will help in your situation and don't already have a copy perhaps this provide insentive/leverage to get a copy.
Thank you all for your replies and suggestions. I like the idea that if a connection is dropped, windows should disable user from entering data into FileMaker evn though I do not know how to make it happen.
In the FM12 help document about committing data in records, it says that pressing Enter on the numeric keypad on windows will commit data, which is like the save command in MS word. Will adding the extra Enter on the numeric keypad force FM to save the record when the connection via VPN is dropped? I am thinking that this should work for Craig's case and people need to force committing when they step away.
Thank you for sharing your thoughts about this,
Your first question:
I like the idea that if a connection is dropped, windows should disable user from entering data into FileMaker
This is the way FMP works. If the connection is dropped then any action by the user that causes the client to attempt to contact FMS will result in the "Lost connection with host' message. Entering a field does not require contacting FMS. Contact examples: attempting to edit a field, view a new record, or change layouts will cause the client to contact FMS for a record-lock on the changed record or current information on the newly displayed record or layout.
Will adding the extra Enter on the numeric keypad force FM to save the record when the connection via VPN is dropped?
You've defined a condition that precludes the event you want from happening.
Imagine you have a vault door (VPN) and you've opened it so you can get into the safe (the computer) and your safe-deposit-box (FMS). Now close the vault door and lock it. Can you now get into the box? Can you even get into the safe? Obviously the answer is NO.
In this scenario there is no way for the client to even see the computer let alone update the record.
Third question (Craig's case):
Force committing when someone has walked away is a scenario fraught with user dissatisfaction. How do you determine when the person has 'walked away' or is simply thinking or started talking to a co-worker? If you make it time based when do you start the timer and when is it 'up'? The user must then ask, "How long do I have before the developer decides I've taken too long?".
I suspect if you describe this scenario to your users, "If they don't finish their work on a specific entry in less than 5 minutes the data will be entered anyway." that you will get many different unhappy responses.
Script timers attached to the data entry fields that record character submissions and one for leaving/committing the field might help to know when to start and stop the timer. But my guess is very few users will be happy with the performance or imposed restrictions for data entry. WAN access may aggravate this to unusable levels.
I suggest training the employees to use the solution (including but not limited to frequently committing the changes) would be a more cost effective and user friendly approach. Add a "Save now" button for them to use.
In the FM12 help document about committing data in records, it says that pressing Enter on the numeric keypad on windows will commit data, which is like the save command in MS word. Will adding the extra Enter on the numeric keypad force FM to save the record when the connection via VPN is dropped?
If the connection has dropped out pressing the Enter key signal will not make any difference.