apply PE_createNewRevision from client method
- 5 years ago
Hi Lucas
Can you update your client side method with below code
var wnd = aras.getMainWindow();
var topWnd = aras.getMostTopWindowWithAras(window);
wnd = wnd === topWnd ? wnd.main : topWnd;
var selectedId;
var itemTypeName;
var innovator = new Innovator();
if (wnd.parent.main) {
itemTypeName = wnd.parent.main.work.itemTypeName;
selectedId = wnd.parent.main.work.grid.getSelectedItemIds();
} else {
itemTypeName = wnd.itemTypeName;
selectedId = [wnd.itemID];
}
if (selectedId.length < 1) {
return;
}
var contextItem = innovator.newItem(itemTypeName, "get");
contextItem.setAttribute("id", selectedId);
contextItem = contextItem.apply();
if (!contextItem.isError()) {
var confirmation;
confirmation = aras.confirm("creation of new major revision ?");
if (confirmation !== true) {
return false;
} else {
contextItem.setAction('PE_CreateNewRevision');
var result = contextItem.apply();
if (result.isError()) {
return top.aras.AlertError(result.getErrorString());
}
}
}Let me know if it works.
Thank You
Gopikrishnan R