Generation

generate functionTue, 17 Jan 2023

servicenow query business rule to filter out all inactive users

function onBefore(current, previous) { //Type appropriate comment here, and begin script below var gr = new GlideRecord('sys_user'); gr.addQuery('active', false); gr.addQuery('department', '!=', 'Service Desk'); gr.query(); while(gr.next()) { current.removeOption(gr.sys_id.toString()); } }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant