Hi,
maybe it is a silly question but I can't manage it. I have a relationship item "Part Integration" and it has a customized property "integration_number". I want this to be visible in the main Part search grid. I tried to uncheck hidden1 and hidden2 but nothing happens.
thank you in advance
Duygu
Hi OEAKDEMIR,
Few changes in your code will work. string my_type = this.getType(); will give the Item type of the relationship.
Innovator inn = this.getInnovator();
string my_id = this.getID();
string my_type = this.getType();
Item query = inn.newItem(my_type , "get");
query.setAttribute("id", my_id);
var result = query.apply();
string created_on = result.getProperty("created_on");
string source_id = result.getProperty("source_id");
return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type = " + my_type);
Result:
created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config
However, you can use the below code to get the created_on, type and source_id of the relationship directly.
Innovator inn = this.getInnovator();
string created_on =this.getProperty("created_on");
string source_id=this.getProperty("source_id");
string my_type = this.getType();
return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type" + my_type);
Result:
created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config
Both query will return same result.
Hi OEAKDEMIR,
Few changes in your code will work. string my_type = this.getType(); will give the Item type of the relationship.
Innovator inn = this.getInnovator();
string my_id = this.getID();
string my_type = this.getType();
Item query = inn.newItem(my_type , "get");
query.setAttribute("id", my_id);
var result = query.apply();
string created_on = result.getProperty("created_on");
string source_id = result.getProperty("source_id");
return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type = " + my_type);
Result:
created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config
However, you can use the below code to get the created_on, type and source_id of the relationship directly.
Innovator inn = this.getInnovator();
string created_on =this.getProperty("created_on");
string source_id=this.getProperty("source_id");
string my_type = this.getType();
return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type" + my_type);
Result:
created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config
Both query will return same result.