Hi all,
i need to compare the value of a field before and after user modification.
The variable containing the “before” value must be accessible in the logichook after_save.
I tried to set a “public” variable in the class and fill it in before_save_method but it seems this doesn’t work.
Any suggestions? Thanks.
Hi,
assuming this is the class/method mentioned in your hook registration:
class MyHookClass {
function myFunction($bean, $event, $arguments){
if($bean->your_field_c !== $bean->fetched_row['your_field_c']){
//execute your code here -> field has changed
} else {
//some other code
}
}
}
E: this should work for after_save directly.
E2: typo, I replaced === with !==