Forum Discussion
I was able to create the following C# script that seems to work well and no syntax errors however i am new to C#. Can someone look at my script to see if i have it designed correctly? This is on the Pre-event of a life cycle transition.
String product = this.getProperty("product", "");
if(product == "")
{
return this.getInnovator().newError(String.Format("The 'Product' field is required.", this.getProperty("keyed_name", "")));
}
String change_description = this.getProperty("change_description", "");
if(change_description == "")
{
return this.getInnovator().newError(String.Format("The 'Changes Requested' field is required.", this.getProperty("keyed_name", "")));
}
String change_reason = this.getProperty("change_reason", "");
if(change_reason == "")
{
return this.getInnovator().newError(String.Format("The 'Reason for Changes(s)' field is required.", this.getProperty("keyed_name", "")));
}
String req_comp_date = this.getProperty("req_comp_date", "");
if(req_comp_date == "")
{
return this.getInnovator().newError(String.Format("The 'Requested Completion Date' field is required.", this.getProperty("keyed_name", "")));
}
return this;