Hide sections on workspace

Vinya Jakkula
Tera Contributor

Hi Team please help me how to hide sections in service operations workspace based on assignment group.

I have created a ui policy and selected view as sow eventhough not working.

11 REPLIES 11

@Vinya Jakkula 

it should work fine provided you are giving correct section name and that section doesn't have mandatory field

share your client script config screenshots and what debugging did you do?

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

Please check this 

1000046567.png

1000046566.png

  

@Vinya Jakkula 

it worked for me

try to add alert and see if it went inside

function onLoad() {
    //Type appropriate comment here, and begin script below
    if (top.location.href.indexOf('/now/sow') > -1) {
        alert('inside');
        g_form.setSectionDisplay('related_records', false);
    }
}

related records hide section.gif

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

@Ankur Bawiskar alert is getting on load but section is not hiding.

@Vinya Jakkula 

It worked for me -> did you check?

which workspace you are checking? you should use that in the script with it's prefix

I used sow and hence I added that

share what came in your URL?

Also any field is mandatory in that section? if yes then make that field non-mandatory and then hide

function onLoad() {
    //Type appropriate comment here, and begin script below
alert(top.location.href);
    if (top.location.href.indexOf('/now/sow') > -1) {
        alert('inside');
        g_form.setSectionDisplay('related_records', 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