- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 09:06 AM
Hi Community,
I have a Business Rule which updates 2 HR Case Fields values:
- State -> Work in Progress,
- Assigned to -> HRlegal Test
When these fields are updated, I need to refresh the Form in the HR Agent Workspace for HR Case Management to see the "Preview Document" Button (displayed when State changes to Work in Progress).
How to automatically refresh the form to be able to see the Button, please ?
Best Regards,
Paul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 02:50 AM
Hi Community,
I resolved the issue by creating a Client Script on HR Case table, onChange 'Assigned to'. It saves/reloads the form.
HR Case with New Hire Contract CDI Service: Automatically save/reload the HR Case form when 'Assignment Group' is changed to 'HR Legal' and 'Assigned to' changed.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || isTemplate || newValue === '') {
return;
}
if (g_form.getValue('assignment_group') === '16fda1321ba0621063b2a8e8b04bcb20' && g_form.getValue('hr_service') === '06f70487874356103c66cbf5cebb354f') {
// Save the form and reload after save completes
g_form.save(function() {
location.reload();
});
}
}
Best regards,
psypniew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2025 07:19 AM
Hi @psypniew ,
Please check the below thread:
https://www.servicenow.com/community/developer-forum/refreshing-the-incident-page/m-p/1608133/page/2
Please mark helpful and correct answer if it's worthy for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 02:50 AM
Hi Community,
I resolved the issue by creating a Client Script on HR Case table, onChange 'Assigned to'. It saves/reloads the form.
HR Case with New Hire Contract CDI Service: Automatically save/reload the HR Case form when 'Assignment Group' is changed to 'HR Legal' and 'Assigned to' changed.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || isTemplate || newValue === '') {
return;
}
if (g_form.getValue('assignment_group') === '16fda1321ba0621063b2a8e8b04bcb20' && g_form.getValue('hr_service') === '06f70487874356103c66cbf5cebb354f') {
// Save the form and reload after save completes
g_form.save(function() {
location.reload();
});
}
}
Best regards,
psypniew