The CreatorCon Call for Content is officially open! Get started here.

How to Hide Form Sections?

MBarrott
Mega Sage

I'm wanting to hide the Preferences section from the Project Task form (pm_project).

 

From what I'm seeing there's no clear/easy way to flip an Active field like a lot of things on forms. 

 

Is there a simple solution to hiding form sections?

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @MBarrott,

 

This is easily resolved by leveraging the following method via a UI Policy or a Client Script. (UI Policy is best practice)

 

//Example code snippet using the incident form and the 'Resolution Information' Tab/Section

g_form.setSectionDisplay('resolution_information',false);

 

Tip: The section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example, "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the getSectionNames method.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

If you need advice or guidance on how to set up a UI Policy, see the following link: https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/form-administra...

View solution in original post

15 REPLIES 15

Robbie
Kilo Patron
Kilo Patron

Hi @MBarrott,

 

Was my response helpful and enable you to hide the section? Let me know if I can help you close out this question. 

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie