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

elanrajad
Tera Contributor

Hi Team,

We have check box field on form if check box is checked need to hide button without saving the form and if check box is unchecked   need to show   the button on form without using DOM .Any one Can help me..

Thanks

Elanraj

1 ACCEPTED SOLUTION

nitish99
Tera Guru

Hi Elanraja,



1) Create a UI Policy --> Set Condition as field (check_box) is true


2) In the Script tab set Run scripts true


3) In the if condition write        


                  $$('#action_name')[0].hide();     //This will hide the top button


                  $$('#action_name')[1].hide();     //This will hide the bottom button as well



4) In the else condition write        


                  $$('#action_name')[0].show();     //This will show the top button


                  $$('#action_name')[1].show();     //This will show the bottom button as well



For reference,


check this How to hide/show an UI action on field changes


View solution in original post

29 REPLIES 29

Eduardo7
Tera Contributor

Okay, to hide just the botton button you may try the following:

 1.- create a ui script in a Global Scope

   *Go to the filter navigator, type Ui script and select system ui -> ui script

Eduardo7_0-1668622828500.png

 *Then click in new button to create a new ui script

Eduardo7_1-1668622987996.png

  *Give a name to your ui script.

  *check the global field

  *in the script field create a function and hide all the Ui action you want, remember, the Id of the button Ui actos is "action name"_bottom

2.- Create a Onload client script to call your ui script

Eduardo7_2-1668623230476.png

  *In the script field, you only need to call the function from your Ui script, save both recod and reload the form.

now the resolve incident button is still in the top

Eduardo7_3-1668623404869.png

and the resolve incident button in not in botton.

Eduardo7_4-1668623449320.png

 

 

 

 

 

 

RM238
Tera Contributor

Hey @Eduardo7 ,it works! Many many thanks!!! 😀

XYD23
Tera Contributor

Can you help me this is not working for me!

 

Hi, XYD23. Could you please create a new post? Someone would be more likely to help on a post that hasn't been solved yet.

Eduardo7
Tera Contributor

Sure.

can you show me how you intend to achieve this? please