Skip to content
🚀 Rapid Application Development with the App Builder

preUpdate

The preUpdate hook is executed before a row is updated. It allows developers to prevent the update based on custom logic.

Parameters

ParameterTypeDescription
getColumnValuefunctionSee getColumnValue(columnName)
setColumnValuefunctionSee setColumnValue(columnName, columnValue)
setColumnStylefunctionSee setColumnStyle(columnName, cssStyle)
setValidationErrorfunctionSee setValidationError(columnName, errorMessage)
unsetValidationErrorfunctionSee unsetValidationError(columnName)

Return Value

Return false to cancel the update, or true to proceed with the update.

✨ Example of a preInsert Hook

This example prevents updates when the column status has the value "INIT".

js
((getColumnValue, setColumnValue, setColumnStyle, setValidationError, unsetValidationError) => {

	const value = getColumnValue("status")

	if (value === "INIT") {

    	wpda.alert("ERROR", "Insert not allowed!")		// Use built-in alert
        wpda.snackbar("Insert not allowed!", "error")   // Use built-in snackbar
      
        return false

    }

})