In Microsoft Dynamics 365 Finance and Operations (D365 F&O), menu items are the links that can be clicked on to access forms, reports, classes, jobs, and queries. Feature keys are typically used to control the visibility of menu items based on user licenses. However, there are scenarios where you might want to hide menu items conditionally without relying on feature keys.
This can be accomplished by extending the 'SysMenuNavigationObjectFactory' class and modifying the checkAddSubMenu(...) method.
Suppose we want to hide the Vendor payment journal menu item under Accounts payable > Payments > Vendor payment journal
Steps
1. Create an extension of the SysMenuNavigationObjectFactory class
2. Create a Chain of Command (CoC) for the checkAddSubMenu method
3. Add your conditional logic to control the visibility of the menu item
While feature keys are a powerful tool for controlling menu item visibility, there are situations where conditional hiding without relying on them is necessary. By leveraging this X++ code, you can achieve flexible and dynamic menu item visibility in D365 F&O.
Comments
Post a Comment