Make a script only target a specific form view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 05:36 AM
We have a resolve dialog to be able to close mutliple incidents at the same time.
The form view for this has 5 fields you need to fill in.
In the field Ticket type I want to hide one of the values. Is this possible to do?
I've tried to make a client script like this, but it doesn't work.
Active: True
Global: False
View: resolvedialog
Type: onLoad
Table: Incident
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.removeOption('u_ticket_type', 'srq')
}
If I try the same script but make it global, it'll remove the option srq for all views so the actual script seems to be working, it's just not targeting the form view I want.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 05:45 AM
I just found out that the script actually is working when I open the incident form and switch to the resolvedialog view.
When it doesn't work is when the view is shown in a glideDialogWindow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 05:50 AM
Nice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 05:53 AM
It's nice it's working but I still need to hide the values in a glideDialogWindow... That's my problem now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 06:00 AM
Found this from ServiceNow Guru
GlideDialogWindow: QuickForms - ServiceNow Guru
The biggest drawback to this method is that it DOES NOT run client scripts or UI policies. Because of this, you'll need to put a little more thought into exactly how you use it to present fields. It is also designed to ONLY work as a list action. The 'showQuickForm' method has also had some issues in the past (including a recent one with the ListV2 plugin). These issues have been resolved in the Fall 2010 Service-now release. If you're seeing issues, chances are you need to upgrade.
Doesn't seem like it's possible to use client scripts for a glideDialogWindow.
Any way I can go around this?