Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Get Role Name

$
0
0
Hi, I am not an expert on JAVA by any means, but I found a script that brings the current user role(s), inside this script there is a line with the following text GetRoleName of the current role, when I execute this script I get the following error:
Field: the_field_I_am_using
event: onchange
Error: 'getRoleName' is undefined
 
The script is supposed to work, since I found it everywhere on the internet and no one seems to have an issue with the GetRoleName.  Any clues what I am missing here?  This is the simple java function I am using
 
function CheckUserRole() {
    var currentUserRoles = Xrm.Page.context.getUserRoles();
    for (var i = 0; i < currentUserRoles.length; i++) {
         var userRoleId = currentUserRoles[i];
    var userRoleName = getRoleName(userRoleId);
    alert (userRoleName)
}
}
 

Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>