Skip to content
🚀 Rapid Application Development with the App Builder

onRowInit

The onRowInit hook allows developers to execute custom code after a row was initialized. This hook fires when a form is (re)opened.

Parameters

ParameterTypeDescription
modeenumINSERT | UPDATE | VIEW
getColumnValuefunctionSee getColumnValue(columnName)
setColumnValuefunctionSee setColumnValue(columnName, columnValue)
setColumnStylefunctionSee setColumnStyle(columnName, cssStyle)

Return Value

None

✨ Example

Applies a default value to column type depending on the users role.

js
((mode, getColumnValue, setColumnValue, setColumnStyle) => {

	if (mode === "INSERT") {
		if (app.userHasRole("admin")) {
			setColumnValue("type", "admin")
		} else {
			setColumnValue("type", "user")
		}
	}

})