Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created January 11, 2021 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgillis-aras/38a5e8413c504b2817e2ddf745e11267 to your computer and use it in GitHub Desktop.
Save cgillis-aras/38a5e8413c504b2817e2ddf745e11267 to your computer and use it in GitHub Desktop.
Examples of shorthand functions for adding items to a query in Aras Innovator.
Innovator inn = this.getInnovator();
Item part = inn.newItem("Part", "get");
// Add a Part BOM relationship to this query
Item partBom = inn.newItem("Part BOM", "get");
part.addRelationship(partBom);
// Shorthand equivalent
Item partBom = part.createRelationship("Part BOM", "get");
// Add an Item property to this query
Item createdBy = inn.newItem("User", "get");
part.setPropertyItem("created_by_id", createdBy);
// Shorthand equivalent
Item createdBy = part.createPropertyItem("created_by_id", "User", "get");
// Add a related item to this query
Item relatedPart = partBom.createPropertyItem("related_id", "Part", "get");
// Shorthand equivalent
Item relatedPart = partBom.createRelatedItem("Part", "get");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment