Show/Hide Form Sections

xiaix
Tera Guru

I read (in full) Show/Hide Form Section by Name - ServiceNow Guru

So... when using g_form.setSectionDisplay(), where do you define the section name????

What field on the sys_ui_section will go in the first parameter of g_form.setSectionDisplay() ???

I tried the following:

find_real_file.png

find_real_file.png

But it doesn't work.

find_real_file.png

1 ACCEPTED SOLUTION

This is not correct. Naming conevtion is as follows


"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."


View solution in original post

7 REPLIES 7

g_form.setSectionDisplay('hardware_serialnumbersandassettags', false);




Worked!!  


smcdonaldaz
Tera Guru

I added the following to an onLoad client script to get the exact names:

   var sections = g_form.getSectionNames();
   alert(sections);

 

Vignesh D
Tera Contributor

Hi

However the above method cannot be used for Related list tabs in a form. Follow this 

Create a UI policy

    Set no condition -> Save

    Go to 'UI Policy Related list action' -> Click New

    Select 'the related list tab' that you want to set visible as false and save