var topWindow = aras.getMostTopWindowWithAras(window);
var workerFrame = topWindow.work;
// START custom code: Check if Item is already opened in tab or tearoff window
// Doesn´t work for Actions, Methods, Reports,...
// Works for Parts, Documents, Identities, Permissions,...
var id = workerFrame.grid.getSelectedID(); // get id of item selected in grid
var openWindows = aras.windowsByName;
for (var winName in openWindows) {
var win = openWindows[winName];
var winItem = win.thisItem;
if (winItem && winItem.node.id === id)
{
return alert("'Save As' can not be applied to opened items. Please close the corresponding item first.");
}
}
// return alert("Window is not open" ); // Debug
// END custom code
if (workerFrame && workerFrame.onSaveAsCommand) {
workerFrame.onSaveAsCommand();
}
This code improves Save As for all end-user relevant ItemTypes like Part, Document, etc.
For some reason, it does not work for code-heavy item types like Method or Reports.
Would be happy if somebody else could give this one a try!
Angelavar topWindow = aras.getMostTopWindowWithAras(window);
var workerFrame = topWindow.work;
// START custom code: Check if Item is already opened in tab or tearoff window
// Doesn´t work for Actions, Methods, Reports,...
// Works for Parts, Documents, Identities, Permissions,...
var id = workerFrame.grid.getSelectedID(); // get id of item selected in grid
var openWindows = aras.windowsByName;
for (var winName in openWindows) {
var win = openWindows[winName];
var winItem = win.thisItem;
if (winItem && winItem.node.id === id)
{
return alert("'Save As' can not be applied to opened items. Please close the corresponding item first.");
}
}
// return alert("Window is not open" ); // Debug
// END custom code
if (workerFrame && workerFrame.onSaveAsCommand) {
workerFrame.onSaveAsCommand();
}
This code improves Save As for all end-user relevant ItemTypes like Part, Document, etc.
For some reason, it does not work for code-heavy item types like Method or Reports.
Would be happy if somebody else could give this one a try!
Angela