Hi,
Is it possible to have defferent Values in DropDown for defferent roles? For example.
Role 1 Wil see
Value 1
Value 2
Role 2 Wil see
Value 3
Value 4
Hi,
Is it possible to have defferent Values in DropDown for defferent roles? For example.
Role 1 Wil see
Value 1
Value 2
Role 2 Wil see
Value 3
Value 4
I don’t think this is possible without writing some custom code.
You can add a javascript file to the page by editing custom/modules/YourModuleName/metadata/editviewdefs.php to add
‘includes’ =>
array(
0 =>
array(
‘file’ => ‘custom/modules//YourModuleName//js/yourjavascriptfilenamejs’,
),
),
Then you’d need to write javascript to update the dropdown on page load, you may need to make an AJAX request to find out the role of the current user.
If you don’t feel confident doing this yourself please feel free to contact SalesAgility for a quote:
javascript is a problem, will try to find other way
You possibly could try with a logic hook and a dynamic dropdown
If you set a two level dropdown in which the first is the role and the second is the Value you are looking for this is achievable in an edit view.
Thye logic hook is needed wne you open the edit view so that it selects the value of the first dropdown automatically so that the values of the second dropdown are shown as per your example.
The first dropdown should be hidden in the edit view.
This is just an idea, but you could work on it to find a viable solution
Thank you for idea! Will try.
I found somthing ineresting (defferent DropDown Values for defferent USERS), it needs to change for roles (or batter to Securyty Group)
http://cheleguanaco.blogspot.ru/2013/04/sugarcrm-customization-user-specific.html
We can take roles for current user
$obj = new ACLRole();
$roles = $obj->getUserRoles($GLOBALS['current_user']->id);
So, this is the answer for my question B)