- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 05:47 AM
Hi All,
I have created a record producer to be used on a customer portal to create incidents. This has many variables, but the answer to 'what is the incident related to?' (inc_rel_to) decides which variables appear to the user to be answered.
I have add the Incident Variable Editor to the incident form, but I only want this to show the variables that have been answered - currently it displays all the variables on the record producer regardless of if these were visible when the ticket was submitted.
I have created the display business rule on the incident table:
I have also created the following client script:
However all the variables are displaying when I load an incident in the normal servicenow UI that has been created by my record producer.
Any help as to where I am going wrong will be greatly appreciated.
Thanks
Sam
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 05:51 AM
Hi,
Check below links.
How to hide some specific variables from Variable editor on Incident form.
Record Producer UI Policies in Incident Variable Editor
Thank you,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 06:02 AM
Hi Ashutosh,
I need this to be dynamic, so if more variables get added in the future the script will still cater for these.
From what I can see line 6 of my client script is doing what was suggested in the first link you provided?
Thanks
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 05:59 AM
Sam,
It looks like you pulled this from the SNGuru Site. Have you tried displaying infomessages to see if your scratchpad variable is populated? Also, be sure your BR is set to run onDisplay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 06:08 AM
In your Business Rule you never declare the emptyVars variable as an array. Add the following at line 3 and this should solve your issue:
var emptyVars = [];