This record has changed since you selected it.

Experts, I am working on creating incidents using a java script The actual requirement is , one of the team will send me a feed from their system on a daily basis, which i need to read and create incidents in HP SM. This is basically for the tracking and reporting purpose. The actual resolution of the issue would have already been completed. I am reading the csv file via HP Connect-It scenario and inserting into one of the staging table.There is a schedule which polls this table based on the custom status field value and creates the incident (probsummary) Now , i have mapped the fields and am doing a doAction("save") , it gives me the error as "This record has changed since you selected it." There is no validations or anything on the form specific formatctrl as well as on the master fc. If I doInsert() after assigning the number, it inserts successfully. Please guide. thx
Parents
  • var evIn = new SCFile('RecIncoming') var query="ub.number=\"UB-IM-1127\"" if (evIn.doSelect(query) == RC_SUCCESS) { // do { print(evIn.ub_number); var recIn = new SCFile('probsummary'); var retCod = new SCDatum() var num = new SCDatum() // system.functions.rtecall("getNumber",retCod,num,"incident management") recIn.number = num.getText() recIn.category = "Security" recIn.problem_status="Open" recIn.status="Open" recIn.open_time = system.functions.tod() recIn.opened_by = "Rec_Imported" recIn.priority_code = evIn.ub_cust_priority recIn.assignment="Security" recIn.actual_open_time=evIn.ub_cust_date_discover recIn.alert_subtype=evIn.ub_alert_subtype var a = recIn.action.toArray() var i = a.push("User/IP : " evIn.ub_cust_emp) recIn.action = a; var b = recIn.future_action.toArray() b.push("*************\n" "" "Analyst Notes: " evIn.ub_detailed_desc.toArray()) recIn.future_action = b // recIn.doInsert() recIn.doAction("save") //} while(evIn.getNext() == RC_SUCCESS) }
  • var evIn = new SCFile('RecIncoming') 
    var query="ub.number=\"UB-IM-1127\"" 
    if (evIn.doSelect(query) == RC_SUCCESS) 
    { 
    // do { print(evIn.ub_number); 
    var recIn = new SCFile('probsummary');
     var retCod = new SCDatum() 
    var num = new SCDatum() 
    // system.functions.rtecall("getNumber",retCod,num,"incident management") 
    recIn.number = num.getText() 
    recIn.category = "Security" 
    recIn.problem_status="Open"
     recIn.status="Open" 
    recIn.open_time = system.functions.tod() 
    recIn.opened_by = "Rec_Imported" 
    recIn.priority_code = evIn.ub_cust_priority
     recIn.assignment="Security" 
    recIn.actual_open_time=evIn.ub_cust_date_discover recIn.alert_subtype=evIn.ub_alert_subtype
     var a = recIn.action.toArray() 
    var i = a.push("User/IP : " evIn.ub_cust_emp) 
    recIn.action = a; var b = recIn.future_action.toArray()
    b.push("*************\n" "" "Analyst Notes: " evIn.ub_detailed_desc.toArray()) recIn.future_action = b 
    // recIn.doInsert() 
    recIn.doAction("save") 
    //} while(evIn.getNext() == RC_SUCCESS) }

    Above is the code., which I am trying

Reply
  • var evIn = new SCFile('RecIncoming') 
    var query="ub.number=\"UB-IM-1127\"" 
    if (evIn.doSelect(query) == RC_SUCCESS) 
    { 
    // do { print(evIn.ub_number); 
    var recIn = new SCFile('probsummary');
     var retCod = new SCDatum() 
    var num = new SCDatum() 
    // system.functions.rtecall("getNumber",retCod,num,"incident management") 
    recIn.number = num.getText() 
    recIn.category = "Security" 
    recIn.problem_status="Open"
     recIn.status="Open" 
    recIn.open_time = system.functions.tod() 
    recIn.opened_by = "Rec_Imported" 
    recIn.priority_code = evIn.ub_cust_priority
     recIn.assignment="Security" 
    recIn.actual_open_time=evIn.ub_cust_date_discover recIn.alert_subtype=evIn.ub_alert_subtype
     var a = recIn.action.toArray() 
    var i = a.push("User/IP : " evIn.ub_cust_emp) 
    recIn.action = a; var b = recIn.future_action.toArray()
    b.push("*************\n" "" "Analyst Notes: " evIn.ub_detailed_desc.toArray()) recIn.future_action = b 
    // recIn.doInsert() 
    recIn.doAction("save") 
    //} while(evIn.getNext() == RC_SUCCESS) }

    Above is the code., which I am trying

Children
No Data