how to Call UI action in client script

Shruthi2
Kilo Contributor

Hi,

I have to hide a Ui action on the change form on change of the configuration item. How do I refer to the UI action in the on change client script of the configuration item field.Please help me out

 

Thanks,

Shruthi.

1 ACCEPTED SOLUTION

Hi Shruthi,

Did you set this field to false?

Isolate Script -  false

  • This field is not on form but from list you can make it false
  • by default it is true
  • If that is true DOM won't work

find_real_file.png

Regards
Ankur

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

View solution in original post

17 REPLIES 17

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Shruthi,

UI Action conditions evaluate when form loads and it is not recommended to show/hide the UI action on change of some field using client script

But if you still require script you can refer below links

Note: this would use DOM manipulation

For the client script to work you will have to set Isolate Script field to false

By default that field is set to true; that field is not available on form but from list you can set it to false

Client script code to hide ui action

How to hide UI Action based on field change in form without using DOM?

Regards
Ankur

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

Hi,

I had been thru this post unfortunately I was not able to access the class name or the action name or the id . can you please me

Hi Shruthi,

Is this for native view or portal view?

please check the HTML element for that button

Regards
Ankur

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

Hi,

I did that and found the id and class name of that ui action by using document.getElementById() and Class but it didnot work