- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 02:34 AM
I have a requirement for 'Change Request' that 'Closure Information' Related tab should be visible only after 'Implement' state or in 'Cancelled' state. how to implement it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 04:50 AM
Hi All,
I got the solution.
I can be done using Client Script 'OnLoad'.
function onLoad() {
var st=g_form.getValue('state');
if(st=='-5'|| st=='-4'|| st=='-3'||st=='-2') {
var sections = g_form.getSections();
g_form.setSectionDisplay('closure_information', false);
}
else {
var sections = g_form.getSections();
g_form.setSectionDisplay('closure_information', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 02:41 AM
you can write a UI policy with condition as State = Implement/Cancelled. Under UI action set Closure info field as visible and make the UI policy as 'Reverse if false', so that for other states it is invisible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 02:48 AM
Hi Anubhav,
You can use 'hideRelatedList()' & methods of 'g_tabs2Sections' in client script or UI Policy to hide related lists & sections. Refer below articles for more details
http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#hideRelatedList
Thanks
Abhinandan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 04:04 AM
Hi Anubhav,
Just make an on change client script for change request table on change of State field with following code..
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//checking whether the new value of the state if Implement or cancelled
if (newValue == "Implement" || newValue == "Cancelled")
{
//making the closure information tab visible
g_form.setSectionDisplay('closure_information', true); //Please check for the Tab name and change it
}
else
{
//making the closure information tab invisible
g_form.setSectionDisplay('closure_information', false);}
}
Hope this will be helpful to you.
Thanks
Gopinath L
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2016 04:50 AM
Hi All,
I got the solution.
I can be done using Client Script 'OnLoad'.
function onLoad() {
var st=g_form.getValue('state');
if(st=='-5'|| st=='-4'|| st=='-3'||st=='-2') {
var sections = g_form.getSections();
g_form.setSectionDisplay('closure_information', false);
}
else {
var sections = g_form.getSections();
g_form.setSectionDisplay('closure_information', true);
}
}