March 2017
Beginner
358 pages
9h 51m
English
There are situations where you may want to alter a given user preference as the result of a script running. For example, the Make this my current update set UI Action on Update Set records changes the user preference relating to the user's currently selected update set to the sys_id of the currently opened update set record. Luckily, ServiceNow provides both a client, and server-side API for performing this update.
It is possible to use a client script, business rule, or any client or server-side script to modify a user preference record, by calling one of the following APIs, depending on context:
| Client | setPreference('preference_name', 'preferece_value'); |
| Server | gs.getUser().setPreference('pref_name', 'pref_value'); ... |
Read now
Unlock full access