I want to control the display/hide of tabs depending on the value of the related list.

Kurumi
Tera Contributor

I want to control the display/hide of tabs depending on the value of the related list.

I want to control the display/hide of tabs depending on the value of the related record.
Regarding the display format of the tabs, we are considering two methods: related lists and creating section tabs and embedding the list in the form.

As an example of a related list, I would like to control the display/hide of the tab in the red frame according to the value of the record in the blue frame in the image.
If you know how, please let me know.

Kurumi_1-1703137701219.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Kurumi 

that's possible

1) use display BR on your Incident table and determine the flag if tab needs to be shown/hidden

2) then use onLoad client script on Incident table and based on the flag show/hide the tab

g_form.setSectionDisplay('tabName', 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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Kurumi 

that's possible

1) use display BR on your Incident table and determine the flag if tab needs to be shown/hidden

2) then use onLoad client script on Incident table and based on the flag show/hide the tab

g_form.setSectionDisplay('tabName', 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

@Ankur Bawiskar 
thank you for your reply.
"1)use display BR on your Incident table and determine the flag if tab needs to be shown/hidden"
Please explain in detail because I don't understand this part very well.
What should I set for this BR?
I don't understand how to control it depending on the value of the record in the related list.

@Kurumi 

in that display BR you should query the related list table record and based on field value comparison set the g_scratchpad variable

To find more on scratchpad variable check in docs

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

Thank you for letting me know more about Display BR.
I'll look into the g_scratchpad variable and give it a try.