web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

XrmServiceToolkit.Soap.IsCurrentUserRole function is not working

(0) ShareShare
ReportReport
Posted on by 2,139

Hi. In my Oncreate function related to the e-mail activiy i have added the code below

if (XrmServiceToolkit.Soap.IsCurrentUserRole("Сотрудник МЕКРАНЛАЙН")) {
Xrm.Page.getAttribute("bcc").setValue('test@test.com');
}


unfortunately this is not working. My knowledge in JS is very poor and for this reason i cannot understand where is the error))

*This post is locked for comments

I have the same question (0)
  • betlejuice Profile Picture
    2,139 on at

    Hi Guido. With a standart role name the code also is not working. I will check the function  maybe i can find anything there

  • Suggested answer
    Nizar JLASSI Profile Picture
    2 on at

    Hi Oscar,

    Did you tried to use this standard javascript method :

    Xrm.Page.context.getUserRoles()

    It allows you to get all the current user roles. It returns them as an array of Guids.

    And after that you need only to search if the Guid of your specif role is in this array.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans