var AutopopulateNSSRUserDetails = Class.create();
AutopopulateNSSRUserDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
populateDepartment: function() {
var user = this.getParameter('sysparm_user');
var grUser = new GlideRecord('sys_user');
grUser.addQuery('sys_id', user);
grUser.query();
if (grUser.next()) {
var department = grUser.department.getDisplayValue();
return department.toString();
}
},
type: 'AutopopulateNSSRUserDetails'
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter