Notifications
Announcements
No record found.
Hi,
I need to make the custom menu item invisible in the content pane based on some condition using code (without using security key option). since it needs to be invisible even for sys admin users based on some condition . Is it possible to hide the menus in the content pane through code?
Hi Noob,
I don't think you can disable the menu item in the content pane without using security roles.
Instead of disabling it you can add the code in the init method of the form based on condition and throw warning or error. So, it restricts user to open the form.
Thanks,
Girish S.
Hi NoobGamer,
I'm not fully sure what you mean with the content pane. I do assume it is about a menu item in the menu structure.
This is possible with coding. You must subscribe to the delegate method SysMenuNavigationObjectFactory::checkAddSubMenuDelegate and implement coding like this:
internal final class HideMenuItemDemo { [SubscribesTo(classstr(SysMenuNavigationObjectFactory), staticdelegatestr(SysMenuNavigationObjectFactory, checkAddSubMenuDelegate))] public static void menuItemVisibilityHandler(SysDictMenu _rootMenu, SysDictMenu _subMenu, SysBoxedBoolean _subMenuVisibility) { if (_subMenu.isMenuItem()) { var metaElement = _subMenu.GetMenuItemMetaElement(); if (metaElement != null) { if (metaElement.Name == menuItemDisplayStr(MyMenuItemToHide)) { if (myCondition == outcomeAsHide) { _subMenuVisibility.value = false; } } } } } }
Note that still a user and the system administrator would be able to find and open the item when using the navigation search and URL parameter editing.
I was playing with this last week for the intention of a new blog.
Hi Girish / Andre,
I could Able to hide the displaymenu item and output menu items based on this code and when the user try to open throw the link the I thrown the error(init method ) while opening the form !! It is working fine for the forms but For output menu item how can i throw error while opening throw link ?
Output menu item will be mapped to the SSRS report - If its SSRS report you can add the code in the prePromptModifyContract method of the controller class. Another option will be adding the code on the main method - On the main method you will be calling the startOperation method - If the condition is met call the startOperation method and if not throw warning or error.
If it's a standard, then go for prePromptModifyContract method.
If it's a custom report, then go for main method.
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.
Martin Dráb 611 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader