Validation sequence

The following sequence is followed for the execution of different types of validations when a DML operation is performed:

  1. Call the method handleBeforeProcessRows() on the custom handler once for all the collection of rows that are being posted. The collection of rows includes rows with operations insert, update, delete and validate.

  2. Check if the isSkipDML() method returns the value true on the custom handler. If so, then skip all the steps given below.

  3. Check if the user has access to perform the insert operation on the DataSource. If not, an exception is thrown to the user and all the steps given below are skipped.

  4. If you are performing an update operation, fetch the row from the database matching the primary key values and throw an exception when either zero or more than one rows match the primary key values.

  5. Execute the before insert/update/delete/validate validation script in the order of given sequence.

  6. Invoke the handleBeforeInsertRow(), handleBeforeUpdateRow(), handleBeforeDeleteRow() or handleBeforeValidateRow() method call on custom handler depending on the type of operation performed on a given row.

  7. Set default values based on the attribute definition.

  8. Post the data to the database.

  9. Insert the activity stream.

  10. Execute the after insert/update/delete/validate validation script in the order of given sequence.

  11. Call the handleAfterInsertRow() method on the custom handler.

  12. Call the handleAfterProcessRows() method on custom handler once for all the collection of rows that are being posted.

Note: The steps 3 to 6 are performed in a group for each row in a loop. Similarly, steps 10-11 are performed in a group for each row in the collection.

Last updated