there is a item name -Part
and it has relation -Part_relation
there are a date field and name field in Part_relation
when user update , I want to check the field'value Cannot be earlier than Today
When encountering an error, I will return inn.newError(name + date+" error")
it is my question
When encountering multiple errors, how can I get Part_relation 's information (on the view) show on Error message
in Part's beforeUpdate event?
I think "this.getRelationships();" works, but I failed after testing.
----------------------------------------------------
string log ="";
Innovator inn = this.getInnovator();
Item rootitem = inn.getItemById(this.getType(), this.getID());
//on the view's all relationship
Item thisrela = this.getRelationships();
string today = DateTime.Now.ToString("yyyy/MM/dd");
DateTime nowdate = Convert.ToDateTime(today);
for(int a=0 ; a<thisrela.getItemCount(); a++){
Item tR = thisrela.getItemByIndex(a);----> it can't run
//on view's date
string updateday = Convert.ToDateTime(tR.getProperty("ts_complete_date")).ToString("yyyy/MM/dd");
DateTime update = Convert.ToDateTime(updateday);
if(DateTime.Compare(nowdate,update)>0){
log += "tR.getProperty("name")+update+" Error.";
}
}
if(log!=""){
return inn.newError(log);
}