Creating security role automatically, when someone installs our app.
code.msdn.microsoft.com/.../sourcecode;pathId=401413335. This resolved my issue. Thank you so much :)
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?
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156