Testing Whether a Field's Value Is Changed

You can test whether a field's value has changed in the current transaction by using the built-in isAttributeChanged() function.

As shown in this example, it takes a single string argument that provides the name of the field whose changed status you want to evaluate:

if (isAttributeChanged('Status')) {
  // perform some logic here in light of the fact
  // that status has changed in this transaction
}