Need to Reject an Item Promote

You want to reject an Item Promote if a value of Property is invalid.

Technique

Use the Pre Server-Method on the Life Cycle Transition to call a server-side Method to validate the Item before it is promoted and if invalid rejects the Promote by returning an Error Item.

C#

Innovator innovator = this.getInnovator();
if (Convert.ToDecimal(this.getProperty(“cost”)) > 500) {
Item error = innovator.newError(“Error promoting: Item costs more than $500.00");
return error;
}
return this;