Found a solution, I used jquery instead. I put it before the return $str on the display() function of the file: root/include/EditView/EditView2.php
if($this->returnModule == 'Accounts' && $this->module == 'Opportunities') { $data = BeanFactory::getBean($this->returnModule, $this->returnId); if($data->id) { $user = BeanFactory::getBean('Users', $data->assigned_user_id); $str .= " <script> $(function() { $('input#assigned_user_name').val('{$user->first_name} {$user->last_name}'); $('input#assigned_user_id').val('{$user->id}'); }); </script>"; } }
This will only work on Accounts detail view Opportunities subpanel