How can i hide field choices on incident form.

Atchutaram
Tera Contributor

Hi Team,

                  I need to hide Closed and Cancelled state choices.  and i have wrote  onload client script.

g_form.removeOption('state' , 'closed') its not working.

 

And i have to hide on hold and resolved, when state is New. How can i do this?

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Atchutaram Here is the code you should use to remove the closed state.

    g_form.removeOption('state', '7'); //closed state       

 

Here are the state values.

 

Screenshot 2024-03-20 at 3.42.16 PM.png

 

Hope this helps.

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Atchutaram 

 

May i know , what is reason to hide these? Any business case, because hiding may cause impact on process.

 

https://www.servicenow.com/community/incident-management-forum/only-new-state-visible-when-creating-...

 

See Anurag reply. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sandeep Rajput
Tera Patron
Tera Patron

@Atchutaram Here is the code you should use to remove the closed state.

    g_form.removeOption('state', '7'); //closed state       

 

Here are the state values.

 

Screenshot 2024-03-20 at 3.42.16 PM.png

 

Hope this helps.

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You need to pass the value of the choice as the second parameter (not label). Please check if you are doing that.

-Anurag