Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

XrmServiceToolkit.Soap.IsCurrentUserRole function is not working

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
    Nizar JLASSI 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
    betlejuice 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans