Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Manage Team Roles with javaScript

Posted on by Microsoft Employee

Hello everyone,

I would like to assign a security role to a Team A during a Business process flow. Then I would like to remove it. I meet some difficulties. Indeed I don't know the JavaScript function to assign a security role to a Team. Do you have any idea?

Here is my code:

function OnLoad() {

 // *** Whenever the stage changes trigger an onchange function

 Xrm.Page.data.process.addOnStageChange(stageOnChange);

}

function stageOnChange() {

	var stage = Xrm.Page.data.process.getActiveStage();
	var stageName = stage.getName();

if (stageName=="S1") {
	//Team A get security Role 1
} else if (stageName=="S2") {
	//Team A lose securit Role 1	
}


 

Thanks a lot,

Léo

*This post is locked for comments

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Manage Team Roles with javaScript

    Hi Leo,

    On what build are you on?

    In order to assign a security role to a team, you would need to generate an associate request.

    If you are using CRM 8.x or later you can use the web API for this - See following example: msdn.microsoft.com/.../mt607875.aspx

    You can se the REST Builder to help you generate the JS code that can do this operation github.com/.../CRMRESTBuilder

    Hope this helps,

    Radu

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