Last active
February 22, 2019 14:56
-
-
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
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"); | |
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