Populating Fields in Catalog Item Form for Non-ITIL Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2024 05:40 AM
So I am seeing users with no roles (non ITSM users) are causing issues with the population of fields for my Requests. I need a fix for this and I think I have found a way of how to do it but I just need someone to write me the appropriate scripts for my idea to work. It goes as follows:
1. Create a Script Include that fixes this main issue.
2. Alter this client script below to use the script include that you have written so they both work together as intended and this issue of mine can be fixed.
Client Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Added by Maria Schabo - 06/13/2023 - Populate the Employee fields automatically when the employee is selected
populate_department_field();
populate_supervisor_field();
populate_phone_field();
populate_email_field();
function populate_department_field() {
//Get reference
var caller = g_form.getReference('employee', findDept);
function findDept(caller) {
//Set the Dept field
g_form.setValue('employee_dept',caller.department);
}
}
function populate_supervisor_field() {
//Get reference
var callerr = g_form.getReference('employee', findSupervisor);
function findSupervisor(callerr) {
//Set the Supervisor field
g_form.setValue('employee_supervisor',callerr.manager);
}
}
function populate_phone_field() {
//Get reference
var callerp = g_form.getReference('employee', findPhone);
function findPhone(callerp) {
//Set the Phone field
g_form.setValue('employee_phone',callerp.phone);
}
}
function populate_email_field() {
//Get reference
var callere = g_form.getReference('employee', findEmail);
function findEmail(callere) {
//Set the Email field
g_form.setValue('employee_email', callere.email);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2024 05:41 AM
@swathisarang98 Please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 06:19 AM
Hi @msekla ,
Could you please elaborate the issue you are facing ?in the above issue is not clear
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang