How to restrict condition fields using client script (not ACL)

hartr
Giga Contributor

Hi,

Does anyone now how to remove choices from a condition type field using a client script (something similar to g_form.removeOption )?

That way I can present the users with a shorter list of relevant fields and exclude all the others..

thanks

01-07-2016 12-13-41.jpg

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Russell,



A quick look through dictionary attributes indicates one called RestrictTo. I haven't used it before, but it looks like it might do what you need. It appears to be some type of redirection (you'll need another field with comma separated field names apparently.) Not sure, as I said, haven't used it before.



Dictionary Attributes - ServiceNow Wiki


View solution in original post

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi Russell,



A quick look through dictionary attributes indicates one called RestrictTo. I haven't used it before, but it looks like it might do what you need. It appears to be some type of redirection (you'll need another field with comma separated field names apparently.) Not sure, as I said, haven't used it before.



Dictionary Attributes - ServiceNow Wiki


Thanks Chuck - that works well using a separate field on the form.



I need to see if I can get it to work with a system property or some other way as I want to put the condition builder field onto a UI Page.


Glad it worked. Don't forget to mark the original comment correct so others can find it in the future.



Here's a way to use the field in combination with the property. Set the default value of the field to



javascript:gs.getProperty('my.field.list');



Using your property of course.


HI Chuck,



Can you explain how to use RestrictTo in attribute.



need some example pls