How to run Client Scripts and UI Policies on HR Agent Workspace and Case Creation forms

tahnalos
Kilo Sage

We have set up our HR services with Record producers and have included them in our Employee Center.  All of them have Catalog UI Policies and Catalog client scripts and they go to their respective COEs.

However on our HR Agent Workspace and Case Creation pages, we want the same policies and scripts to run on those services as well.  We have set up UI Policies and Client Scripts on the sn_hr_core_case form only to realize that they are not working.

Is there any specialized interface that we need to run in order to replicate the same behavior as present in our Record Producers?

9 REPLIES 9

kaushal_snow
Giga Sage

@tahnalos ,

 

You’ll need to make sure those scripts and policies are configured for the workspace ui because the workspace uses a different form view and scripting context than the classic platform interface.......so simply having them work on the record producer doesn’t guarantee they’ll fire in agent workspace.......specifically your client script need their ui type set to include workspace/all and appropriate view scope, and your ui Policies must either be global or set with the workspace view selected so that they apply in that interface........

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Technical Consultant - ServiceNow Class of Legends 2025

swaghosh
Tera Expert

If you need to run client script and UI policy only in configurable workspaces, make sure you uncheck the Global check-box and specify the view name as workspace while running your UI policy or client. This ensures that it will run only for workspace but not for any other view

Ankith Sharma
Giga Guru

Hi @tahnalos ,

 

Adding to what @kaushal_snow  and @swaghosh have shared above, there’s an important architectural distinction to be aware of, 

Catalog UI Policies and Catalog Client Scripts only run in the Service Catalog / Record Producer runtime. They do not execute on HR Case forms, including HR Agent Workspace and Case Creation.

 

HR Agent Workspace does not reuse the Record Producer UI engine, so adding UI Policies or Client Scripts on sn_hr_core_case will not automatically replicate Record Producer behavior.

To achieve similar behavior in Workspace, you’ll need to rebuild the logic using Workspace-compatible Client Scripts and UI Policies (UI Type = Workspace or All) and ensure the logic targets case fields rather than catalog variables. For HRSD use cases, a recommended approach is to leverage Data Brokers and mapping to pass values from Record Producers into the HR Case and apply logic there.

 

In short, there’s no specialised interface to reuse Record Producer scripts in Workspace. The logic must be implemented for the Case form context.

 

If you find this useful, kindly mark it as Accept as Solution and Helpful.

Regards,
- Ankit
LinkedIn: https://www.linkedin.com/in/sharmaankith/

 

Hello Ankith.  Allow me to clarify my situation.

I am well aware that catalog client scripts and Catalog UI policies work differently on Record producers and Catalog items.  The reason why I brought them up is that I cannot start ANY client script on the sn_hr_core_case form and that even a simple client script with an alert line shows that the client script isn't running at all.   So it isn't a coding error, it looks like Agent Workspace or case creation isn't running ANY client script or UI policy.

So that's the problem, how do I set up the workspace and the case creation to run the scripts that I want it to run?