Announcements
No record found.
I have a scenario in which custom button should be hide and show as per security role and status reason.
Hello,
Check the below links:
1. Show/Hide button based on security role (applied for system and custom buttons): www.powerobjects.com/.../
2. Show/Hide button based on status reason: community.dynamics.com/.../358240
Yes, you can handle this scenario with a custom rule using JavaScript !
function IsUserHasRoles() { // GUID of role to check var roleId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; // Get all the roles of the Logged in User. var currentUserRoles = Xrm.Utility.getGlobalContext().userSettings.securityRoles; for (var i = 0; i < currentUserRoles.length; i ) { var userRoleId = currentUserRoles[i]; if (userRoleId == roleId) { // Return true if the Role matches return true; } } return false; }
Mehdi,
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ManoVerse 73 Super User 2026 Season 1
Muhammad Shahzad Sh... 69 Most Valuable Professional
11manish 50