- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:27 PM
Hello,
I know that what I've written is a bunch of nonsense, but I am horrible at scripting and I would really like some help.
My goal is , once I type in a User (subject_person) to auto-populate my form field (appraisal_due_date) with the information that is on the HR Profile (u_appraisal_due_date).
Pertinent Information:
Name of my Script Include: getUserHRProfileInformation
Name of HR Profile: sn_hr_core_profile
Name field on HR Profile: user
Here is the Nonsense the I have:
_____________________________________________________________________
Script Include:
Solved! Go to Solution.
- Labels:
-
Human Resources Service Delivery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 06:08 AM
@Hola Ola Please try the following version.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var abc = g_form.getValue('subject_person');
var ga = new GlideAjax('sn_hr_core.getUserHRProfileInformation');
ga.addParam('sysparm_name', 'getUserHRProfileInformation');
ga.addParam('sysparm_user', abc);
ga.getXMLAnswer(getResponse);
function getResponse(response) {
g_form.setValue('appraisal_due_date', response);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 05:31 AM
@Hola Ola My bad, I shared an incorrect client script earlier. Please try the following and see if it works.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var abc = g_form.getValue('subject_person');
var ga = new GlideAjax('sn_hr_core.getUserHRProfileInformation');
ga.addParam('sysparm_name', 'getUserHRProfileInformation');
ga.addParam('sysparm_user, abc);
ga.getXMLAnswer(getResponse)
function getResponse(response) {
g_form.setValue('appraisal_due_date',response);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 06:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 06:08 AM
@Hola Ola Please try the following version.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var abc = g_form.getValue('subject_person');
var ga = new GlideAjax('sn_hr_core.getUserHRProfileInformation');
ga.addParam('sysparm_name', 'getUserHRProfileInformation');
ga.addParam('sysparm_user', abc);
ga.getXMLAnswer(getResponse);
function getResponse(response) {
g_form.setValue('appraisal_due_date', response);
}
}