How to make field empty- It's an Emergency please

chanikya
Kilo Sage

A roundly 592 records of Emp co-ordinator field got Default user name ,

How can i make field empty at a time to all records.

My script is not working:

var grd=new GlideRecord('sys_user');

grd.addEncodedQuery('u_emp_no=NULL');

//grd.addEn('u_emp_no=NULL');

grd.query();

while(grd.next())

{

current.u_emp_manager= '';

}

find_real_file.png

1 ACCEPTED SOLUTION

Prateek kumar
Mega Sage

Chanikya


Please navigate to-- system definition>>Scripts- Background from the filter navigator and run this script


Script:


var str = "employee_number=NULL";


var gr = new GlideRecord('sys_user');


gr.addEncodedQuery(str);


gr.query();


while(gr.next()){


gr.u_emp_manager = '' ;


gr1.setWorkflow(false);


gr1.autoSysFields(false);


gr.update();


}



Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

10 REPLIES 10

Hi Prateek,



It is working fine, thanks..!