Notifications
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 83 Super User 2025 Season 2
Gerardo RenterÃa Ga... 49 Most Valuable Professional
#ManoVerse 40