I know how to lookup the main menu items for the target tracker screen and disable the action menu but not the Openwith menu and sub-items:
// Examine display main key for all Menus:
var obj= MainController.GetType().InvokeMember("ToolManager", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, null, MainController, null);
var tools = (Infragistics.Win.UltraWinToolbars.UltraToolbarsManager)obj;
// Commented out because this only need to explore all the menu key IDs.
string toolnames = "";
foreach(var t in tools.Tools)
{
toolnames += t.Key +" , ";
}
MessageBox.Show(toolnames);
The end goal is if possible to disable open with on an order using a define security group on order entry or the process context menu. But disallowing the order entry menu item using a security group is not the same on the calling process menu?
During my initial testing for the Salesperson Workbench, the Action menu item and Openwith Order Entry traced process calling Menu ID does respect the assigned security group. I tested this from the EpicorTraining DB. I will proceed with this method and keep you posted. I should note this method does not required any code customization within the target form. I think as long as a defined MenuID associated with a SEC code is called by the parent process, and not a business object (DLL or others) , the security group method should work.
As you can see from the earlier snapshots, the OpenWith will utilize a different Menu ID than the Action Menu or possible the Add button. However, in this case they both Menu IDs share the same security code. As this MAY NOT be the case all the time. You need to make sure all referenced MenuIDs are sharing the same security code so when you make the change to disallow/allow by security group it will apply to all appropriate MenuIDs sharing the same security code. .
Note, this method will only work if the parent form is calling a MenuID process and not a direct business object (BO). Furthermore, after clicking on the still visible Button, Openwith menu item, or Action menu item, the user will notice the pop-up message “Your account does not have access to this Menu ID”.
Using C# code method allows mea bit more control. I can make the Menu ID or button invisible based on a granted security group to the user account. As a result, the user will not see the button or menu id to click on it.