Back
save()
Saves the object if it passes validation and callbacks.
Returns true
if the object was saved successfully to the database, false
if not.
// Save the user object to the database (will automatically do an `INSERT` or `UPDATE` statement depending on if the record is new or already exists
user.save();
// Save the user object directly in an if statement without using `cfqueryparam` and take appropriate action based on the result
if(user.save(parameterize=false)){
flashInsert(notice="The user was saved!");
redirectTo(action="edit");
} else {
flashInsert(alert="Error, please correct!");
renderView(action="edit");
}
Copied!