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
  • Without knowing the exact structure of your itemtypes, it´s hard to say whats missing. 1. Do you get any error message? 2. If not, add an error handler to the apply Method:
    newResult = newResult.apply();
    if (newResult .isError())
    {
        return inn.newError(newResult .getErrorDetail()); 
    } 
    3. One of your properties is called date. Is this one really a String property? 4. Are the field sizes equal? 5. Can Add / Permissions correct? 6. If you try the other properties indepentently, do they all work? 7. Where do you trigger this code and which event is used?
Reply
  • Without knowing the exact structure of your itemtypes, it´s hard to say whats missing. 1. Do you get any error message? 2. If not, add an error handler to the apply Method:
    newResult = newResult.apply();
    if (newResult .isError())
    {
        return inn.newError(newResult .getErrorDetail()); 
    } 
    3. One of your properties is called date. Is this one really a String property? 4. Are the field sizes equal? 5. Can Add / Permissions correct? 6. If you try the other properties indepentently, do they all work? 7. Where do you trigger this code and which event is used?
Children
No Data