Model Configuration
afterUpdate()
Signature
Section titled “Signature”afterUpdate() — returns void
Available in: model
Category: Callback Functions
Description
Section titled “Description”Registers method(s) that should be called after an existing object is updated.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
methods | string | no | — | Method name or list of method names that should be called when this callback event occurs in an object’s life cycle (can also be called with the method argument). |
Examples
Section titled “Examples”// 1. Register a single method to run after an object is updated
// In models/User.cfc
component extends="Model" {
function config() {
afterUpdate("clearCache");
}
private function clearCache() {
// invalidate cached data for this user
}
}
// 2. Register multiple methods by passing a comma-delimited list
afterUpdate("clearCache,notifyAuditLog");
// 3. Register using the named `methods` argument
afterUpdate(methods="syncToSearchIndex");