Hi everyone,
I am a bit confused how I should be checking which field changed upon save.
this is what my current code does:
Public static function test($data1, $mode, $data2)
{
if($mode == 'edit')
{
$f = fopen('/tmp/crm.txt', 'w');
fwrite($f, print_r($data1).PHP_EOL);
fwrite($f, print_r($data2).PHP_EOL);
fclose($f);
}
elseif($mode == "editing")
{
print_r($data1);
}
when I edit a company record I see all of the record information at the top hence the print_r($data1) command is working.
When I save a change, a new file is created (/tmp/crm.txt) but when I look at it the contents shows:
1
1
so I'm a bit confused on what that's about 😛
what I am trying to do is when you save, I want to compare the old record with the new updated record.
then proceed with additional execution with my code.
can someone please let me know if I was on the right track or if I have to do something different?
Also if you can, please provide a simple example.
Thanks everyone,
jjjj12212