Skip to content

Model Configuration

afterUpdate()

afterUpdate() — returns void

Available in: model Category: Callback Functions

Registers method(s) that should be called after an existing object is updated.

NameTypeRequiredDefaultDescription
methodsstringno—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).
// 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");