The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Make a script only target a specific form view

palmen
Tera Guru

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.

18 REPLIES 18

palmen
Tera Guru

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


yetesh_ch
ServiceNow Employee
ServiceNow Employee

Nice


It's nice it's working but I still need to hide the values in a glideDialogWindow... That's my problem now


palmen
Tera Guru

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?