This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Innovator inn = this.getInnovator(); | |
Item part = inn.newItem(); | |
/* All of the pairs of functions below are equivalent */ | |
// Set the type attribute | |
part.setAttribute("type", "Part"); | |
part.setType("Part"); | |
// Set the action attribute | |
part.setAttribute("action", "get"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Innovator inn = this.getInnovator(); | |
Item newPart = inn.newItem("Part", "get"); | |
newPart.setAttribute("returnMode", "countOnly"); | |
newPart.setAttribute("page", "1"); | |
newPart.setAttribute("pagesize", "10"); | |
newPart = newPart.apply(); | |
// The results when using returnMode="countOnly" look different than a normal item, | |
// so we need to retrieve them in a different way. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Innovator inn = this.getInnovator(); | |
Item newPart = inn.newItem("Part", "add"); | |
newPart.setProperty("item_number", "New Part 1"); | |
newPart.setAttribute("doGetItem", "0"); | |
newPart = newPart.apply(); | |
// You can still validate the response when using doGetItem | |
if (newPart.isError()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eventState = {}; | |
var topWindow = aras.getMostTopWindowWithAras(window); | |
var item = topWindow.item; | |
var itemType = topWindow.itemType; | |
if (item) { | |
var itemTypeName = topWindow.itemTypeName; | |
var isTemp = aras.isTempEx(item); | |
var isDirty = aras.isDirtyEx(item); | |
var isNew = aras.isNew(item); | |
var lockedBy = aras.getItemProperty(item, 'locked_by_id', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eventState = {}; | |
var topWindow = aras.getMostTopWindowWithAras(window); | |
var item = topWindow.item; | |
var itemType = topWindow.itemType; | |
if (item) { | |
var itemTypeName = topWindow.itemTypeName; | |
var isTemp = aras.isTempEx(item); | |
var isDirty = aras.isDirtyEx(item); | |
var isNew = aras.isNew(item); | |
var lockedBy = aras.getItemProperty(item, 'locked_by_id', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For 11.0 SP15 | |
return ModulesManager.using( | |
['aras.innovator.GraphView/GraphWindowView', | |
'aras.innovator.core.ItemWindow/DefaultItemWindowCreator' | |
]).then(function (View, Creator) { | |
require(['GraphView/Scripts/GraphDataLoader'], function (GraphDataLoader) { | |
inArgs = { | |
// Specify the ID of the GVD to be used | |
gvdId: 'F04DC7C054CA48DA886A0B336BD61E37' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* NOTE: This code is a sample to demonstrate how to rollup one level of a relationship. | |
* It is has not been fully tested and should not be used in a production environment as-is. | |
*/ | |
/* Query for item and relationships happens above */ | |
parentPart = parentPart.apply(); | |
// Get the relationships from your item | |
Item partBoms = parentPart.getRelationships("Part BOM"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* We need to wait for the item's form to fully load before we switch the window to edit mode. | |
* Luckily, aras.uiShowItem returns a Promise that happens to resolve once the window loads. This | |
* means we can pass in a function using Promise.then(ourFunction) that will be called after the | |
* Promise resolves and the item window is loaded. | |
*/ | |
aras.uiShowItem("Part", "64B2100E21B44980B42FB445951310BF").then(function() | |
{ | |
// Look up the tab that was just loaded | |
var myItemWin = aras.uiFindWindowEx("64B2100E21B44980B42FB445951310BF"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var applyWithSpinner = async function(itm) { | |
aras.browserHelper.toggleSpinner(document, true); | |
var res = await itm.applyAsync(); | |
aras.browserHelper.toggleSpinner(document, false); | |
return res; | |
} | |
// Create a query we know will take a while like querying for all Methods in the system | |
var longQueryItem = aras.IomInnovator.newItem("Method", "get"); | |
var res = await applyWithSpinner(longQueryItem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scopeIds = {}; | |
// Use a simple lookup table to get the value of the | |
var asilLookup = getAsilLookupTable(); | |
// We want to style the ASIL value based on how important it is | |
var qmStyle = inArgs.factory.createCmfStyle(); | |
qmStyle.textColor = "#000000"; | |
qmStyle.textDecoration = "none"; | |
qmStyle.fontWeight = "normal"; |