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

From this page...



https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/reference-pages/conce...



The attribute is used on a condition field and would be set something like this



restrictTo=u_field_list



Then u_field_list is a string field that contains things like number,priority,u_abc



Now when the condition field is used, the first list of fields in the drop down doesn't show all the fields (that the user has read access to), it just contains the ones specified in u_field_list's comma separated values.


Hi Chuck,



can you please help Where to define this filed list and how can I define.


Is it like  


1) if the fields are listed in the u_field _list and restictto is given for the attribute in dictionary, will it restrict the fields ?



Thanks