trigger store

Trigger that responds to a request to save (store) the data.

Declaration: trigger store
Applies to: Form
Activation: Activated by the structure editor function ^STORE
Default behavior: Implicitly validates all unvalidated fields, keys and occurrences and then executes done
Behavior upon completion: None

Description

By default, the store trigger contains the store statement with ProcScript to check for any store errors. If the store action was successful, it commits the stored data; otherwise, the changes are rolled back.

The store statement activates the following triggers:

  • write or writeUp trigger of each occurrence that has been modified or newly entered. Unmodified occurrences are not stored.
  • Delete or deleteUp trigger of each occurrence that has been removed.

If you want to prevent the user from storing occurrences with certain values, you should put the checks in the field loseFocus trigger, and the leaveModified and leaveModifiedKey triggers. This approach allows the user to be informed about the error at the point of data entry, rather than later when the data is stored. The write trigger is an alternative place for these checks, but is not recommended.

Related Topics