source descriptor is empty while recording access for table sn_si_incident: no thrown error

Skanda1
Tera Contributor

Getting this error when I try to run a business rule which is in the same scope. Tried to use the same solution as this: https://community.servicenow.com/community?id=community_question&sys_id=288b72681b8068106531ea89bd4bcbe3 but the scopes are different so I'm not sure what changes to make

1 ACCEPTED SOLUTION

@Skanda 

alert at line 12 won't work as alert() is used in client side, so remove that

also you should set the value again at line 14

current.other_ioc = cur_ioc;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Skanda1
Tera Contributor

Apologies Ankur , the alert() function was the error. Removing it has fixed it.
The script is working for new additions but doesnt work for previously existing ones.
Any fix to this?

 

@Skanda 

Glad to know that my comment helped.

For older records you need to write fix script

(function(){

	try{
		var gr = new GlideRecord("table name"); // your table name here
		gr.addEncodedQuery("other_iocISNOTEMPTY");
		gr.query();
		while(gr.next()) {
			var cur_ioc = gr.other_ioc;

			// your code for replacement here

			gr.other_ioc = cur_ioc;
			gr.setWorkflow(false);
			gr.update();
		}
	}
	catch(ex){
		gs.info(ex);
	}

})();

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader