How do I create a client script just for Agent Workspace?

Amy13
Tera Contributor

Looking to clear a field on the Incident form with an onChange client script. I want this done for Agent Workspace -- how do I do create one such that it executes in Workspace?

Note: I've got a UI Policy set up that works for the platform and Agent Workspace. However the "clear value" field ONLY works in the platform and not in workspace (not sure why). 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can specify the view for your client script as -> workspace

then write your code which would run only for the workspace view

find_real_file.png

Regards
Ankur

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

View solution in original post

9 REPLIES 9

Aman Singh_
Kilo Sage

Hi Amy,

Create a normal client script as you do for the platform,

Use g_form.clearValue('<field_name>');//to clear value

Make sure the UI Type for the client script is set to All.

 

Thanks,

Aman

Hi Amy,

Thanks for marking my response as helpful.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

 

Thanks,

Aman

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can specify the view for your client script as -> workspace

then write your code which would run only for the workspace view

find_real_file.png

Regards
Ankur

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

@Ankur Bawiskar 

 

I don't see that view field on my side. 

find_real_file.png