Created
August 21, 2018 20:01
-
-
Save cgillis-aras/c475865454101a90fbe3dddbc45b80f2 to your computer and use it in GitHub Desktop.
Example code that will successfully add a sibling Document from an onBeforeAdd on the Document ItemType using fake proeprties
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(); | |
if (this.getProperty("is_sibling") == "1") { | |
return this; | |
} else { | |
Item newDoc = inn.newItem("Document", "add"); | |
newDoc.setProperty("item_number", this.getProperty("item_number") + " - Design"); | |
newDoc.setProperty("name", this.getProperty("name") + "'s Sibling"); | |
newDoc.setProperty("is_sibling", "1"); | |
newDoc = newDoc.apply(); | |
} | |
return this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment