Skip to content

Miscellaneous

updateProperty()

updateProperty() — returns any

Updates a single property and saves the record without going through the normal validation procedure. This is especially useful for boolean flags on existing records.

NameTypeRequiredDefaultDescription
propertystringyesName of the property to update the value for globally.
valueanyyesValue to set on the given property globally.
parameterizeanyyestrueSet to true to use cfqueryparam on all columns, or pass in a list of property names to use cfqueryparam on those only.
transactionstringyes[runtime expression]Set this to commit to update the database when the save has completed, rollback to run all the database queries but not commit them, or none to skip transaction handling altogether.
callbacksbooleanyestrueSet to false to disable callbacks for this operation.
updateProperty(property, value [, parameterize, transaction, callbacks ]) <!--- Sets the `new` property to `1` through updateProperty() --->
<cfset product = model("product").findByKey(56)>
<cfset product.updateProperty("new", 1)>