Skip to main content

Notifications

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

  • Suggested answer
    Nizar JLASSI Profile Picture
    2 on at
    RE: XrmServiceToolkit.Soap.IsCurrentUserRole function is not working

    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.

  • betlejuice Profile Picture
    2,139 on at
    RE: XrmServiceToolkit.Soap.IsCurrentUserRole function is not working

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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans