How should I do for getting current role of User .
Can anyone help me on this ? Thank you :)
Please refer this blog post community.dynamics.com/.../get-user-roles-associated-with-current-user it has example how to get all roles for current user.
Can you explain your question? It seems like the title and content of your question are not completely matching. At least it confuses me what you want to learn.
Why you want to find role through code and then disable button with code . Can you do that using security settings ?
The question is not quite clear to me. However would like to know if this is something you are looking for as mentioned below.
--- Disable the 'Enabled' check box at user level in 'User' form? If YES, then this access should be lying with the person who has been assigned to system admin role. If you don't give access to any common user to get through this module, then he/she will never be able to access this module.
--- Whether you want to see what are the roles assigned to a particular user? If YES, then you can filter the record in 'User' form > select the particular user and click on the User ID. It will take you inside that user detail where you can find list of roles assigned. Else, you can click on the right arrow of 'Related Information' area in the 'User' form. It will list down all roles whatever is assigned to that user.
Yes Yes Can you tell me more specific about using security settings to control button
thank you very much for help me
Look at this link and read about NeededPermission Property of a Control
Thank you it works
Business Applications communities