Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 01:29 PM
Hi @Alan42 ,
Update the UI Type = All and add an alert method for "availableHours" to check the return value on portal.
function onLoad() {
var userEmail = g_user.email;
var ga = new GlideAjax('VacationHoursFetcher');
ga.addParam('sysparm_name', 'getVacationHours');
ga.addParam('email', userEmail); // Ensure this parameter matches what the Script Include expects
ga.getXMLAnswer(function(response) {
var availableHours = response.responseXML.documentElement.getAttribute('answer');
alert("availableHours-->"+availableHours);
g_form.setValue('vacationbalance', availableHours); // Ensure this field ID is correct
});
}
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution