Hello
I made 2 Item Type , the first one called (Input) , the second is Result .
i made 4 input in the first one ( Input ) and i want to save the values in Result . Result contain fields : Id , date , name , comment
i passed the value in server side , but i do know how can i save it in Result .
my code :
Innovator innovator = this.getInnovator();
var input = this.getProperty("string");
var input1 = this.getProperty("string1");
var input2 = this.getProperty("string2");
var input3 = this.getProperty("string3");
Item newResult = innovator.newItem("Result","add");
newResult.setProperty("id",input.ToString());
newResult.setProperty("date",input1.ToString());
newResult.setProperty("name",input2.ToString());
newResult.setProperty("comment",input3.ToString());
newResult = newResult.apply();
Parents
Former Member
Thank you for your response .
if I save only one value, there is no problem, for example
Innovator innovator = this.getInnovator();
var input = this.getProperty(“string”);
var input1 = this.getProperty(“string1”);
var input2 = this.getProperty(“string2”);
var input3 = this.getProperty(“string3”);
Item newResult = innovator.newItem(“Result”,”add”);
newResult.setProperty(“input_id”,input.ToString());
newResult = newResult.apply(input);
but if I save id, date, name, comment does not work . the new code is :
Innovator innovator = this.getInnovator();
var input = this.getProperty(“string”);
var input1 = this.getProperty(“string1”);
var input2 = this.getProperty(“string2”);
var input3 = this.getProperty(“string3”);
Item newResult = innovator.newItem(“Result”,”add”);
newResult.setProperty(“id_input”,input.ToString());
newResult.setProperty(“date”,input1.ToString());
newResult.setProperty(“name”,input2.ToString());
newResult.setProperty(“comment”,input3.ToString());
newResult = newResult.apply();
return innovator.newResult(input1);
Thank you for your response .
if I save only one value, there is no problem, for example
Innovator innovator = this.getInnovator();
var input = this.getProperty(“string”);
var input1 = this.getProperty(“string1”);
var input2 = this.getProperty(“string2”);
var input3 = this.getProperty(“string3”);
Item newResult = innovator.newItem(“Result”,”add”);
newResult.setProperty(“input_id”,input.ToString());
newResult = newResult.apply(input);
but if I save id, date, name, comment does not work . the new code is :
Innovator innovator = this.getInnovator();
var input = this.getProperty(“string”);
var input1 = this.getProperty(“string1”);
var input2 = this.getProperty(“string2”);
var input3 = this.getProperty(“string3”);
Item newResult = innovator.newItem(“Result”,”add”);
newResult.setProperty(“id_input”,input.ToString());
newResult.setProperty(“date”,input1.ToString());
newResult.setProperty(“name”,input2.ToString());
newResult.setProperty(“comment”,input3.ToString());
newResult = newResult.apply();
return innovator.newResult(input1);