Forum Discussion
I did something similar to enable simple search mode for all relationships grids. I want to belive my example will be usefull to you to find your CUI location and update similar methods:
I've tried to not change the code tree files and perform changes only in the innovator database.
The easiest way to achieve such behavior is to use CUI feature and CUI items. More detailed infomration about this feature and examples you can find in the official documentation:
Aras Innovator XX - Configurable User Interface Administrator Guide.pdf
You will have possibility to override the behavior for specific items, itemTypes or globally for all entire application
You will have possibility to override the behavior for specific identities for different level of application described above.
I will use global presentation to change the behaviour for all items in the innovator
I know that my control is placed in ItemView.Rel-shipCommandBar section:
I will change DropDown CUI item for searchMode:
I will change InitHandler Method to add logic during initialization force search mode for all relship grids:
The comparison view what I've added to init method(cui_common_searchmode_init):
The method code is below:
const arasInstance = window.aras;
const redlineViewController = window.redlineController;
const shouldSearchDialogEventBeInvoked = window.searchContainer._onSearchDialogEventMustBeInvoked();
const initProperties = {
value: currentSearchMode && currentSearchMode.id,
disabled: (redlineViewController && redlineViewController.isRedlineActive) || shouldSearchDialogEventBeInvoked
};
if (!target.options || !target.options.length) {
const searchModes = arasInstance.getSearchModes() || [];
initProperties.options = searchModes.map(function(currentMode) {
return {
label: arasInstance.getItemProperty(currentMode, 'label') || arasInstance.getItemProperty(currentMode, 'name'),
value: arasInstance.getItemProperty(currentMode, 'id')
};
});
}
if (redlineViewController) { //use this condition to detect that we are curently execute this method for relatioship grid actually any other better condition can be used
const searchContainer = window.searchContainer;
const searchModeId = 'BD84BCA3EC064D77BF3772A9D93308B6'; // id if simple search mode
if (searchContainer && searchModeId) {
const gridControl = searchContainer.grid;
searchContainer.showSearchMode(searchModeId);
if (gridControl.RefreshHeight) {
gridControl.RefreshHeight();
}
}}
return initProperties;