Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Last active August 21, 2018 20:00
Show Gist options
  • Save cgillis-aras/ee2a19fd952377fd94685f62bedf3308 to your computer and use it in GitHub Desktop.
Save cgillis-aras/ee2a19fd952377fd94685f62bedf3308 to your computer and use it in GitHub Desktop.
Example code that will cause an infinite loop when trying to create a Document during an onBeforeAdd event of the Document ItemType
// WARNING: This code will cause an infinite loop when run from an onBeforeAdd event on the Document ItemType.
// It is meant to serve as an example only.
Innovator inn = this.getInnovator();
Item newDoc = inn.newItem("Document", "add");
newDoc.setProperty("item_number", this.getProperty("item_number") + " - Design");
newDoc.setProperty("name", this.getProperty("name") + "'s Sibling");
newDoc = newDoc.apply();
return this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment