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

Hi,

uncheck Global checkbox and then you can see that view field

Regards
Ankur

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

Hello Ankur, 

 

I am trying to apply this for a onchange client script where I have to clear the assigned_to field when the assignment group changes.

 

I have tried using below options but none is successful - Kindly have a look.

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
    var description = '';
   //Type appropriate comment here, and begin script below

  // if(description != "simbatestalert"){g_form.clearValue('assigned_to');}
   //g_form.setValue('assigned_to','');
   setTimeout(function () { g_form.clearValue('assigned_to'); }, 100);
}

uncheck the global option then you will be able to see view option

 

Uncheck the global checkbox

can you pls tell what client script need to be written in workspace for getting search option in the workspace

find_real_file.png