hrsd
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 12:00 AM
This onload function should work for only Managers and HRBPs but it is not working
function onLoad() {
function onLoad() {
// Updated as part of STRY0125550, supports in checking if the logged in user is a Manager or HRBP
var userUtilsAjax = new GlideAjax('CCEP_UserManager_HRBPs');
userUtilsAjax.addParam('sysparm_name', 'isManager_HRBP');
userUtilsAjax.addParam('sysparm_userID', g_user.userID);
userUtilsAjax.getXML(processAnswer);
}
function processAnswer(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'true') {
// If the user is a Manager or HRBP, make the field mandatory
g_form.setMandatory('is_this_request_for_you', true);
} else {
// If the user is not a Manager or HRBP, make the field non-mandatory and hide it
g_form.setMandatory('is_this_request_for_you', false);
g_form.setVisible('is_this_request_for_you', false);
}
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2024 07:36 PM
I don't see any issue in your Client script. Can you also please share the script include?
Thanks,
Murthy
Murthy