Forum Discussion
oeakdemir
7 years agoCreator I
Thanks a lot for the information.
I can now access the properties of the relationship denoted by the "this" context object.
But, now, I am blocked by another type of error : I can not set any property of the source part using the value of any property of the relationship.
I am getting an error saying : "An item with the same key has already been added". How can I solve this error ?
The code now is as follows:
Innovator inn = this.getInnovator();
string my_type = this.getType();
string my_id = this.getID();
Item relation = inn.newItem(my_type,"get");
relation.setAttribute("id", my_id);
relation = relation.apply();
string E_no = relation.getProperty("_uzay_rel_e_no");
string source_id = relation.getProperty("source_id");
Item sourcePart = inn.newItem("Part","edit");
sourcePart.setAttribute("where", "[Part].id = '" + source_id + "'");
sourcePart.setProperty("_uzay_part_e_no",E_no);
sourcePart = sourcePart.apply();
return inn.newError("nb.of items found = " + sourcePart.getItemCount());