Page focus is dirty in logs when trying to run a UI action 
						
					
					
				
			
		
	
			
	
	
	
	
	
Options
			
				
					
	
			
		
	- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 01:24 PM
In my PDI I am creating a script to approve all of the items associated with a request and have the script below to approve all of the items. However, in the logs I am getting "Page focus is dirty". I am unsure what would cause this and how to resolve the issue. I have attached the script below:
function reqApproval() {
	gs.log("approval running");
    var ritm = new GlideRecord("sc_req_item");
    ritm.addQuery('number', current.number);
    ritm.query();
	
	current.state = '3';
	current.update();
    //set current record to approved
    while (ritm.next()) {
		gs.log("ritm approved");
		ritm.approval = "Approved";
		ritm.req_state = "Approved";
		ritm.update();
    }
	
	var req = new GlideRecord("sc_request");
	req.addQuery('number', current.request);
	req.query();
	
	while(req.next()){
		gs.log("req approved");
		req.state = '3';
		req.update();
	}
	
	gs.log("approval complete");
}
Additionally here is the configuration to the script:
		
			
				
						
							Labels:
						
						
		
			
	
					
			
		
	
	
	
	
				
		
			
		
			
					
			
		
				
		
			
		
	
	
- Labels:
- 
						
							
		
			User Experience and Design
		1 REPLY 1
	
		
		
			
			
			
					
	
			Options
			
				
					
	
			
		
	- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 12:39 AM
Hi sn_ella,
Looks like this is because of some other script.
Please check the below link. Hope this will be useful to debug.
If my reply is Helpful/Correct, please mark the answer as Helpful/Correct.
Thanks,
Harish
