The problem is obvious - you update ZipCode
only and your code doesn’t include the logic you ask for. The only way how it could magically happen is if it was implemented in update()
( because that’s the only method you call), but it isn’t the case. You need to call modifiedFieldZipCode()
after setting ZipCode
and before updating the record.
The form calls modifiedField()
method, which then calls modifiedFieldZipCode()
. But if you write code, it’s up to you to call what you want.
By the way, your code won’t work anyway, because you’re trying to update a record that you’ve never selected. Either use a find*()
method with the _update
parameter set to true
, or use select forUpdate
statement. Do it in the same transaction as the update. Then you can also throw away your call of selectForUpdate()
method.