Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..
573 views

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
I am Listening..
0 Likes
4 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: This record has changed since you selected it.

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) }
I am Listening..
0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: This record has changed since you selected it.

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

I am Listening..
0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: This record has changed since you selected it.

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() 
	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 . (minor correction)

I am Listening..
0 Likes
Highlighted
Established Member..
Established Member..

Re: This record has changed since you selected it.

recIn.doInsert() 

 doInsert() will save the record to database directly. will not call document engine.

	recIn.doAction("save") 

doAction will call the document enginee to save the record.

That means when the function in the document engine read the record, system notice it has been changed by your code.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.