I am working on Admin Actions Log Extension. For the reference i am using the link below
I want to get old and new data of customers when we save the customer.
I'm using these events
model_save_afterfor saving old data to the registry and retrieve it to the save after event, but I'm getting old data as null from the registry.
$object = $observer->getObject(); $customer = $this->objectManager->get('Magento\Customer\Model\Backend\Customer')->load($object->getId()); $customerData = $customer->getData(); $this->registryManager->register('adminactionslog_savebefore_data', $customerData, true);
$oldData = $this->registryManager->registry('adminactionslog_savebefore_data'); // var_dump($oldData); I'm getting this value as null
if anyone has a solution please let me know.