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

g_form.setSectionDisplay("sectionName", false) is not hiding section's labels in service portal.

anujdev
Giga Guru

Issue :

 

using g_form.setSectionDisplay("sectionName", false) is not hiding section's   labels in service portal.

Sections are getting hidden but section's label still visible .

Any help pointers ?

Dose any one know solution for this issue?

I am working on Jakarta.

PFA for detail.Form   SITA   Service Portal.png

referred : Hide Sections on Service Portal ,but didn't work out.

7 REPLIES 7

Shishir Srivast
Mega Sage

following the post provided by you, it seems it doesn't work in Jakarta.


But as per the product documentation: setSectionDisplay() is a supported client API: Service Portal and client scripts


  • setSectionDisplay(sectionName, isVisible)


Note: g_form as a global object cannot be used in a widget client controller or in a UI script.



Where are you using the above function. if it's a client script then have you marked the UI Type to All?


Hi , Thanks for reply .



I am using that function onLoad client script :



QTD   Hide Related List to End User   ServiceNow (2).png


NOT   working in PORTAL


can you try with below script.



var sections = g_form.getSections();


sections[4].style.display = 'none';     //index of section kindly check on which index your section has


}



if this does not work



kindly refer the thread below.



Get a form section by name in Fuji


Hi Harsh ,


I had tried getSections() , but it throws "undefined "error on PORTAL .



getSections() working fine on the form level but in PORTAL its not working as well