Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Last active February 22, 2019 14:56
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/4582bce5b63aa28282b1cb624244c294 to your computer and use it in GitHub Desktop.
Save cgillis-aras/4582bce5b63aa28282b1cb624244c294 to your computer and use it in GitHub Desktop.
Example of setting a value of a related item in an onBeforeDelete event in Aras Innovator
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");
related.setID(rel.getProperty("related_id"));
related.setProperty("name", "NEW_VAL"); // <-- Set the value of your linked property here.
related = related.apply();
if (related.isError())
{
return related;
}
return this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment