I'm using the function beforeSave(), In my case I need to get a reference of the value of a field before the save button was clicked. I used $record->val("fieldhere"), but that gives me the updated value rather than the value before it was updated. I need it to compare the value before it was updated to after the field was updated.
I was thinking, creating a function that accepts the value of the field in one of your functions before the beforeSave() occurs then call that custom function in beforeSave() to return the value to compare to the updated field. I'm not sure if this is the correct way to handle this. If I did do it this way I'm not sure which function to use to retain the value in.
beforeAddExistingRelatedRecord?
beforeAddNewRelatedRecord?
beforeAddRelatedRecord
beforeCopy
beforeDelete?
beforeRemoveRelatedRecord?
beforeSave
beforeInsert?
beforeUpdate?