current user variable

I’m running Version 7.9.14 Sugar Version 6.5.25 (Build 344)
I have to create a pdf template containing the full name of the logged user.
i found these lines in the sugarcrm forum i’d like to know if this could be useful.

<?php
global $current_user;
$user = BeanFactory::getBean('Users', $current_user->id);

$fieldData = $user->my_field_c;

If you try it, and it works, yes, it is useful :slight_smile:

1 Like