Hide Section in the WorkSpace

Kaka_23
Tera Contributor

Hey Community,

 

I've issues with the different behavior in the workspace.

Problem Statement: In the Workspace, I want to hide the section('Impact Section') whenever we create a new record. I've written the Client Script to hide the section, but it works only in the Classic Form UI; it does not work in the Workspace. I've also tried using UI policies, but they are not working. Is there anything I should look into or any suggestions from the community to achieve this ? I've attached the client Script and the Impact Section image as well.

Thanks 
& Regards,

Kaka

3 REPLIES 3

Ranjit Nimbalka
Mega Sage

Hi @Kaka_23 ,

 

This can be achieved via client script or a UI policy you can refer below client script.

 

RanjitNimbalka_0-1735064113274.png

If you want to apply this to only workspace then uncheck global check box and type appropriate view there e.g. sow, sow_new_record.

 

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,

Ranjit

 

You are correct, this should work, but it does not hide the section in the workspace.

This is our code

function onCondition() {
    g_form.setSectionDisplay('agency_sponsorresourcemanager', false);
}
normal tab structure
MikeAdams1_0-1743619778665.png

 

workspace sections

MikeAdams1_1-1743619847420.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Kaka_23 

g_form.setSectionDisplay should work in workspace as well

why not simply use this? why to iterate over the sections

May be g_form.getSectionNames() is not supported in workspace, not sure

function onLoad() {
    if (g_form.isNewRecord())
        g_form.setSectionDisplay('impact', false);
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader