Forum Discussion
angela
7 years agoCatalyst II
Hi Chris,
I can confirm that this one works well in SP11 too! Thanks for the code!
And as I sometimes feel like the queen of usability. I have a brilliant idea of improving the default behavior of "Save As"!
Standard "Save As" is a nice function, quite 80% of our new Parts are created with Save As. But it only works when the original Item is not openend. In reality users most of the time forgot to close the original Item. Save As related question somehow cover 0.42% of my Admin time.
How about modifying the Method "cui_default_mwt_onSaveAsCommand" like this?
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!
Angela