Skip to main content

Notifications

Dynamics 365 general forum

Goal : When someone wants to install our app from dynamics, i want to create one role dynamically for that particular organisation, how can i achieve this, any help would be really appreciated.

Posted on by 25

Creating security role automatically, when someone installs our app. 

  • Himani Sharma Profile Picture
    Himani Sharma 25 on at
    RE: Goal : When someone wants to install our app from dynamics, i want to create one role dynamically for that particular organisation, how can i achieve this, any help would be really appreciated.

    code.msdn.microsoft.com/.../sourcecode;pathId=401413335. This resolved my issue. Thank you so much :)

  • Himani Sharma Profile Picture
    Himani Sharma 25 on at
    RE: Goal : When someone wants to install our app from dynamics, i want to create one role dynamically for that particular organisation, how can i achieve this, any help would be really appreciated.

    Hey Adrian Begovich,

    I am wondering you shared how i can assign that role to the user. But i am looking for how can i create that one role dynamically for different organisations, giving them specific business unit name. Can you please help me with how i can create the role programatically and add it to solution and when ever i deploy that role, i can see that it's created under security role section?

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Goal : When someone wants to install our app from dynamics, i want to create one role dynamically for that particular organisation, how can i achieve this, any help would be really appreciated.

    Hi Himani Sharma,

    You can programmatically associate a Security Role to a User by using the IOrganizationService.Associate method. This article explains how to achieve this. You will need to work out a method for triggering this code when someone installs your application.

  • T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Goal : When someone wants to install our app from dynamics, i want to create one role dynamically for that particular organisation, how can i achieve this, any help would be really appreciated.

    maybe you can have a console application supplementary to the app, where a user can enter their details and create a new role using the CreateRequest. Just an idea

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans