Is it possible to remove/hide a menu 'item' e.g 'Purge' from the 'Main Window Main Menu' for a specific ItemType.
Seems like you can do this for the 'Tearoff Window Main Menu' by adding a init method to
the com.aras.innovator.cui_default.twmm_purge 'Menu Button'.
The method i adds looks like this
-----
var aWindow = top.aras.getMainWindow() == window.top ? top.aras.getMainWindow() : window;
var workerFrame = aWindow.work;
if (workerFrame.itemTypeName === 'myItemType' || workerFrame.itemTypeName === 'myOtherItemType')
{
return {'cui_invisible': true};
}
------
If i try to do the same thing for the com.aras.innovator.cui_default.mwmm_purge menu Button the results seems to be a bit weird
(works for 'myItemType' but not for 'myOtherItemType'???).
I assume the difference lies in when the init method is run for the different menues ??
Any suggestions ?
/regards Johan R.
Hi Johan,
There is a built-in way to remove specific UI buttons that does not require any additional code.
Please follow the steps below to remove the purge button from an ItemType.
Open the 'myItemType' ItemType
Navigate to the 'Client Style' relationship tab
Open this item if one exists
If an item does not exist in this tab, create one
Disable the 'Purge' button from the Main Window Main Menu for this ItemType
In the Command Bar Section relationship tab, select "Create Related" and add a new item with the information below
Classification: Data Model
Name: myItemType Main Window Main Menu
Location: Main Window Main Menu
For Identity [...]: World
Alternatively, you can hide this button only for certain Identities
Open this new Item
In the Command Bar Item relationship tab, select "Pick Related" and add a new item
Search for the button named "com.aras.innovator.cui_default.mwmm_purge"
Set the Action for this item to "Remove"
Set the For Identity [...] to "World"
Save, Unlock, and Close each window until you get back to the main grid.
You can follow similar steps to hide the Purge option in other locations such as the Main Window Toolbar, the Tearoff Window Main Menu, etc.
Chris
__________________________
Christopher Gillis
Aras Labs Software Engineer