Technical Tip 2: Open item in Edit Mode through custom Method
In this section, we will see how to open an item in edit mode using custom method in ARAS V12 version.
Use Case: "Open any item in edit mode using custom method to avoid user from locking / claiming the item"
You can use below code snippet to open any item in edit mode
aras.uiShowItem("Part",getItem.getID()).then(function()
{
var itemEdit = aras.uiFindWindowEx(getItem.getID());
itemEdit.onEditCommand();
});
{
var itemEdit = aras.uiFindWindowEx(getItem.getID());
itemEdit.onEditCommand();
});
Note: getItem.getID() is Item ID of a previous apply()
Example:
var innovator = new Innovator();
var getItem = innovator.newItem("Part", "get");
getItem.setAttribute("select", "id");
getItem.setAttribute("maxRecords", "1");
getItem = getItem.apply();
aras.uiShowItem("Part",getItem.getID()).then(function()
{
var itemEdit = aras.uiFindWindowEx(getItem.getID());
itemEdit.onEditCommand();
});
var innovator = new Innovator();
var getItem = innovator.newItem("Part", "get");
getItem.setAttribute("select", "id");
getItem.setAttribute("maxRecords", "1");
getItem = getItem.apply();
aras.uiShowItem("Part",getItem.getID()).then(function()
{
var itemEdit = aras.uiFindWindowEx(getItem.getID());
itemEdit.onEditCommand();
});
LinkedIn: https://www.linkedin.com/in/gobikrishnanraja/
Comments
Post a Comment