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)
}
}