Client script does not work in new ServiceNow Agent Mobile App

Martin78
Kilo Contributor

I want to remove options from the state choice list. For example, only the "Open" option should be possible in the "New" status. All other status options should be removed. The script does not work with the new Mobile App ServiceNow Agent. How do I change the client script?

The script looks something like this:

function onLoad() {
   var u_state = g_form.getValue('u_state');
    
   if (u_state == 1 ) // Option: "New" -> u_state = 2 is Option: "Open"
  {
      g_form.removeOption('u_state', '3'); // Option: "Resolved"
      g_form.removeOption('u_state', '4'); // Option: "Closed"
   }
}

Any idea?

Thanks!

1 REPLY 1

sachin_namjoshi
Kilo Patron
Kilo Patron

Please make sure that UI type is set to All for your client script.

 

find_real_file.png

 

Regards,

Sachin