Appearance
getColumnValue(columnName)
Retrieves the current value of the specified column.
Scope: FORM
Parameters
| Parameter | Type | Description |
|---|---|---|
| columnName | string | The name of the database table column. |
Parameter columnName can be omitted in form column hooks.
Return Value
| Type | Description |
|---|---|
| any | The value of the specified column. |
| undefined | Returned if the columnName is not found. |
✨ Example of a preFormSubmit using getColumnValue
Prevents updates for the customer with ID 103.
js
((mode, getColumnValue, setValidationError, unsetValidationError) => {
const error = "Customer 103 cannot be updated!"
const customerNumber = getColumnValue("customerNumber")
if (customerNumber == 103) {
// Set validation error
setValidationError("customerNumber", error)
} else {
// Don't forget to reset!
unsetValidationError("customerNumber")
}
})✨ Example of a postFormSubmit using getColumnValue
Sends a notification after a new record is successfully inserted.
js
((responseCode, mode, getColumnValue) => {
if (responseCode === "OK" && mode === "INSERT") {
// Send notification about new customer
const customerNumber = getColumnValue("customerNumber")
window.open("https://mydomain.com/send-notification/" + customerNumber)
}
})