Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of a custom action in Aras Innovator
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();
}
else
{
// If there is a parent, also create a relationship to that parent as part of this add
Item relationshipToParent = inn.newItem("Part BOM", "add");
Item parentPart = relationshipToParent.createPropertyItem("source_id", "Part", "get");
parentPart.setProperty("item_number", parentPartNumber);
relationshipToParent.setRelatedItem(partToAdd);
return relationshipToParent.apply();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment