Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

HR Agent Workspace - Clear Subject Person and Opened for when HR Service Changes

SravanthiK67950
Tera Contributor

In the HR Agent Workspace “Create a new case” page, I need to clear Subject Person and Opened for when the user changes the HR Service after initially selecting a service.

The HR Service-specific fields refresh correctly when the service changes, but Subject Person and Opened for retain the values entered for the previous service.

I reviewed the existing HR Service onChange client scripts, including the logic that shows/hides service-specific fields. I also tested clearing the fields using g_form.clearValue() and g_form.setValue(field, ''), but the case-creation page continues to retain the values.

Is there a supported HR Agent Workspace/HRSD case-creation mechanism or event that should be used to reset these fields when HR Service changes? I would prefer not to modify OOB scripts.

1 REPLY 1

Ankur Bawiskar
Tera Patron

@SravanthiK67950 

client scripts etc won't work in that workspace page as it's a UI builder component.

you might have to clone the variant and then use UI builder scripts etc but it involves too much customization

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader