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?

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

  • Actually nvm. I think I can use this event, which i hadn't heard of before

    SYSMSG
  • Are you using code to call the WRITE event for your form or are you using a QuickEvent? If you are using code, you can usually check @FILE_ERROR to see if it has an error.
  • Using code.

    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?
  • Immediately after your Send_Event call.
  • Ok good in promoted_events. I will have a look.

    btw, do you know what the difference between the two highlighted options are?


  • From the Help button:

    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.
  • edited September 2021
    Thanks, when i click on that help button , I can see the table of contents, but not the contents lol.
  • I assumed that's what happened. These old CHM files are security risks so most systems have their HTML content blocked.
  • Cannot view CHM file over the network (microsoft restriction). You will need to copy the file to a local drive to view.
Sign In or Register to comment.