- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 06:45 AM
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= '';
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:33 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:06 AM
Can you please help me on this thread please
How ''Emp Coordinator'' field should be empty when ''Emp no'' field no value

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:10 AM
var grd=new GlideRecord('sys_user');
grd.addEncodedQuery('managerISNOTEMPTY^user_name=alex.wang');
//grd.addEn('u_emp_no=NULL');
grd.query();
while(grd.next())
{
grd.u_emp_manager = "";
grd.setWorkflow(false);
grd.update();
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:30 AM
HI Chanikya,
See Below : This is background or a Fix script.
var grd=new GlideRecord('sys_user');
grd.addEncodedQuery('u_emp_no=NULL');
grd.query();
while(grd.next())
{
grd.u_emp_manager= '';
grd.setWorkflow(false);
grd.update();
}
Thank you,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:33 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 08:05 AM
Hello Chanikya
Any update on this?
Please mark my response as correct and helpful if it helped solved your question.
-Thanks