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
var set_property = setRelatedItemProperty(relationshipID, "owned_by_id", "DBA5D86402BF43D5976854B8B48FCDD1"); | |
// At this point the value is set on the item in the dom, but it does not seem to appear in the grid | |
// By debugging into this function, the item also does not seem to be added to the grid at this point, so we'll need to handle this logic in a timeout | |
setTimeout(function(relID) { | |
var gridApp = this.gridApplet; | |
var columnName = gridApp.GetPropertyColumnName("owned_by_id"); | |
gridApp.SetCellValue(relID, gridApp.GetTrueColumnIndex(columnName), "Innovator Admin"); // <-- This should be the keyed_name of the item | |
}, 50, relationshipID); |
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(); |
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(); | |
// Get the relationship with the related_id | |
Item rel = inn.newItem(this.getType(), "get"); | |
rel.setID(this.getID()); | |
rel.setAttribute("select","related_id"); | |
rel = rel.apply(); | |
// Make the change to the related item | |
Item related = inn.newItem("Part", "edit"); |
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
// Set the arguments being passed to the dialog | |
var param = { | |
title: "Test HTML", | |
aras: top.aras, | |
dialogWidth: 500, | |
dialogHeight: 250, | |
content: 'test.html' // Put path to HTML file here | |
}; | |
// Open the dialog |
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
// To open any window, it seems the aras object needs an item, so we're creating | |
// a completely blank item with a new ID that we'll use to lookup which window was just opened | |
var newItem = aras.IomInnovator.newItem("", ""); | |
var newItemId = aras.generateNewGUID(); | |
newItem.setID(newItemId); | |
aras.uiOpenEmptyWindowEx(newItem.node); | |
var newWindowName = aras.mainWindowName + "_" + newItemId; | |
var newWindow = aras.windowsByName[newWindowName]; |
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 topWindow = aras.getMostTopWindowWithAras(window); | |
var workerFrame = topWindow.work; | |
var selectedIds = workerFrame.grid.getSelectedItemIds(); | |
var itemTypeName = workerFrame.itemTypeName; | |
var selItems = aras.IomInnovator.newItem(itemTypeName, "get"); | |
selItems.setAttribute("idlist", selectedIds.join(",")); | |
selItems.setAttribute("select", "id,keyed_name"); | |
selItems = selItems.apply(); |