Child pages
  • Data/Record/Column validation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Besides the getProblems() the JSValidationObject has also some extra state, 2 boolean properties: onBeforeInsertFailed and onBeforeUpdateFailed those are filled in if the onRecordUpdate or Insert failed in a legacy way (returning false), here is also a getGenericExceptions() method that will return exception that could be happen in the validation code that are not directly record or column validation problems but more generic once like exceptions that are triggered when the onRecordUpdate or Insert did fail.

Saving

if you call just databaseManager.saveData([record]) then that will also call validate for all the records that are being saved. The save of a record will be blocked when at least one validation problem is reported with the LOGGINGLEVEL of ERROR or FATAL. The save will just go on when only WARN or INFO is used. This can also be asked after validation: JSValidationObject.hasErrors gives back a boolean if this really has errors that blocked the save.

...