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 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"; |
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 want to style the rows of some of our relationships differently based on property value | |
// We're putting this in a Builder Method of a CommandBarSection so that our method is called each time the user | |
// clicks on a new tab. | |
var relationshipWeCareAbout = "159C6D88795B4A86864420863466F728"; // Put ID of relationship here | |
var currentRelationship = parent.relationships.currTabID; | |
// If we show any other relationship, don't do any additional processing | |
if (currentRelationship !== relationshipWeCareAbout) | |
{ | |
return; |
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(); | |
string createdOn = this.getProperty("created_on", ""); | |
if (createdOn == "yesterday") | |
{ | |
DateTime yesterday = DateTime.Today.AddDays(-1); | |
DateTime eodYesterday = yesterday.AddHours(23).AddMinutes(59).AddSeconds(59); | |
this.setPropertyAttribute("created_on", "condition", "between"); | |
this.setProperty("modified_on", String.Format("{0} and {1}", | |
yesterday.ToString("yyyy-MM-ddTHH:mm:ss"), | |
eodYesterday.ToString("yyyy-MM-ddTHH:mm:ss"))); |
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
// Trying to open the classification dialog programmatically | |
var ourItemTypeName = "Part"; // <-- Change this to your ItemType name | |
var ourItemType = top.aras.getItemTypeForClient(ourItemTypeName, "name"); | |
var param = { | |
aras: top.aras, | |
isEditMode: true, | |
itemTypeName: ourItemTypeName, | |
class_structure: ourItemType.getProperty("class_structure"), | |
dialogType: 'classification', |
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 partToAdd = this; | |
partToAdd.setAction("add"); | |
string parentPartNumber = this.getAttribute("parent", ""); | |
if (String.IsNullOrEmpty(parentPartNumber)) | |
{ | |
// If no parent is specified, just add the part like normal | |
return partToAdd.apply(); |