
Originally Posted by
jlabuelo
Hi all
I have a custom field for Contacts module that it is mandatory and it is a dropdown of a list of values.
I know I can set up a default value, but what I would like to do is to pick this default value depending on the assigned user's deparment. I mean I would like, some how, the system to read the department of the assigned user and depending on its value, assign a value to this mandatory dropdown field.
Hi jlabuelo,
you can fetch department of current user on load of view.edit.php
and set department value whatever you want
PHP Code:
global $current_user;
if($current_user->department == 'sugarcrm')
{
$this->bean->designation_dropdown_c = 'developer';
}
Bookmarks