Hello everyone,
I have a requirement wherein i have to retrieve the logged in users security roles. Some of the users have multiple roles.
The code i have used is,
function test() {
var UserRole = Xrm.Page.context.getUserRoles();
alert(UserRole);
for (var i = 0; i < UserRole.length; i++)
alert("Hi");
{
var userRoleId = UserRole[i];
alert("Hi");
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/roles?$select=name&$filter=roleid eq " + userRoleId, true);
But I am not able to get the desired output. I am getting as "Bad Request"error and "undefined" error.
If you could please help!
*This post is locked for comments
I have the same question (0)