Hide Section based on record attribute (State)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 03:47 AM
It seems that ServiceNow does not have mechanism to hide/show sections based on certain condition on server side.
That is why we use to hide/show sections on client side using Client Scripts.
So we all know how ServiceNow Business Rules are being triggered: Business Rules - ServiceNow Wiki
So I wonder if I can leverage that information somehow to make query business rule that will be triggered from another business rule that would filter out section records before they will be displayed. So if I need to hide certain sections for specific record - I need to pass sys_id of that record and condition value for business rule that would be used for decision to show or hide sections.
There are already some pages on this topic:
- Re: Hide and display Form section based on the conditions.
- Re: Unable to hide the section on form
- Hide Form Section - On Change
But they are about using "g_form" object that is client-side and I need to make decision on server side so loading process will get faster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 04:26 AM
well, not sure if I understand correct, but you need to do some server side query to see if a record should hide/show section. What you can do is on a display business rule do the magic, put the result in the scratchpad and then use a quick onLoad client script to hide/show the section based on that value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 05:12 AM
No Client Scripts. I need just server side.
I assume display BR needs to reRun query Business rule on Section table - that is as an idea