Script includes retrieving department head
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 04:07 AM
Im trying to retrieve with an reference qualifier and my client script the department head of the department selected in my configuration item and fill it in manager field in my CI but It doest work :
var EmboardingLibrary = Class.create();
EmboardingLibrary.prototype = {
initialize: function() {
},
retrieveDepartmentHead: function(department){
var grDept = new GlideRecord('cmn_department');
grDept.addQuery('sys_id',department);
grDept.query();
if(grDept.next()){
var deptHead = grDept.dept_head;
return deptHead;
}
},
type: 'EmboardingLibrary'
};
reference qualifier field manager : javascript:new EmboardingLibrary.retrieveDepartmentHead(current.variables.department);
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 04:33 AM
would it be best practice to make an client script and how would I structure it as code ? thank already for your help