Agent Workspace for HR - Client script not working to make field mandatory

Jesse Jones
Tera Expert

Hello,

 

My organization is the midst of a project to migrate from the legacy HR Agent Workspace to the new Agent Workspace for HR. This involves activating a new plugin, which creates a new scope for the UIB-based workspace.

 

In the legacy workspace, we have a simple client script running on Interaction records that evaluates the type of interaction and the current view of the user, then sets a custom choice field to mandatory.

 

JesseJones_0-1716309209191.png

We are using a Client Script instead of a UI Policy because that allows us to create the record in a scope we in HR own instead of Global. Note the Application is in the old HR Workspace scope and the View is set to the legacy view for interactions delivered to the legacy HR Workspace.

 

I have copied this client script to the new scope that goes with the new Agent Workspace for HR plugin:

 

JesseJones_2-1716309414586.png

 

Note that the two scripts are identical except for the scope and the new view. So the functionality should just transfer over. But when I look at an interaction, the script does not kick in for the new view, only the old.

 

Here is the field being made mandatory in the legacy view under the old client script:

 

JesseJones_3-1716309528643.png

 

Here is that same interaction record viewed under the new view, but the field is not made mandatory:

JesseJones_4-1716309557596.png

 

 

Any advice on why this is happening? Thank you.

 

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Jesse Jones 

did you check the onLoad is triggering or not?

Is that contact type field printing value in alert?

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