Hello,
We are facing error on importing data in Contact Module.
This is my after retrieved logic hook:
public function setUserDetails($bean, $event, $args)
{
$user = BeanFactory::getBean('Users', $bean->created_by);
$bean->department = $user->department;
}
This occurs when you have not set up your php.ini with correct error reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING
Never mind. I was able to fixed it. You can use any of the codes below:
$user = BeanFactory::getBean('Users', $bean->created_by);
if(!empty($user)){
$bean->department = $user->department;
}
or this one
global $current_user;
$user = BeanFactory::getBean('Users', $current_user->id);
$bean->department = $user->department;
@abuzarfaris , I was able to figure it out.