Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
How do you know if a save failed?
in OpenInsight
When you save a record in a bound form, you can tell if the save was successful by checking the WRITE event. But if the save fails, then the WRITE event doesn't fire. So how are you supposed to tell if the save succeeded? The reason I need to know this is because we have to use optimistic locking for a bound form, and I need to know if the save failed so that I can manually unlock the record.
Comments
SYSMSG
But the problem with what you have suggested is that the WRITE event is not fired if the save fails, so where would I put the code that checks @FILE_ERROR?
btw, do you know what the difference between the two highlighted options are?
Lock for Update
If you choose Lock for Update, when a read event is issued for a form, exclusive locks will be applied to the primary table row and all rows from subsidiary tables for which either update or either delete operation is permitted before any File Read operations are attempted. Failure of any lock will cause a locking error to be presented and the user will be allowed to continue in view-only mode or to cancel the read operation altogether. Exclusive locks disallow other users from gaining exclusive or shared locks on the same rows. In this mode, Locks will be removed when the form entry is cleared through any mechanism, (for example, write with CLEAR, CLEAR, DELETE, Window CLOSE, or QBF operation).
Lock for Read Only
Lock for Read Only operates similarly to the Lock for Update option except that a shared lock is applied instead of an exclusive lock. A shared lock disallows other exclusive locks but allows other shared locks to be gained against the same rows. Shared locking is not supported on all networks. Only Novell and Banyan networks with the custom drivers currently support shared locks. If shared locking is not supported, this option behaves exactly as does the Lock for Update option.