Save values in Item type

Former Member
Former Member
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
  • I don´t know if this really is the problem, but you often use the var type and .ToString(). For this use case, there is no need to transform the data types.
    Innovator innovator = this.getInnovator();
    string input = this.getProperty("string");
    string input1 = this.getProperty("string1");
    ...
    
    Item newResult = innovator.newItem("Result","add");
    newResult.setProperty("id_input",input);
    newResult.setProperty("date",input1);
    ...
    
    newResult = newResult.apply();
    return innovator.newResult(input1);
Reply
  • I don´t know if this really is the problem, but you often use the var type and .ToString(). For this use case, there is no need to transform the data types.
    Innovator innovator = this.getInnovator();
    string input = this.getProperty("string");
    string input1 = this.getProperty("string1");
    ...
    
    Item newResult = innovator.newItem("Result","add");
    newResult.setProperty("id_input",input);
    newResult.setProperty("date",input1);
    ...
    
    newResult = newResult.apply();
    return innovator.newResult(input1);
Children
No Data