Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to hide Order Now button in portal when variable changes.

prash4
Tera Expert

 I have a requirement where I need to hide Order Now button in portal when a variable option is selected Yes.

2 REPLIES 2

Not applicable

Hi @prash4 ,

You need to use onChange Catalog Client Script.

Here is the sample script:

 

var choice = g_form.getValue('choice_field');
if(choice=='no'){
g_form.setValue('no_order_now','true');
}
else{
g_form.setValue('no_order_now','false');
}

 

 

 

Hi Sandeep, here variable type is Yes or No 

when option is 'yes' then we need to hide Order Now, if 'No' then we need to show the button.

prash4_0-1725289027901.png