IBM Worklight v5.0.5 > API reference > IBM Worklight client-side API > JavaScript client-side APIWL.Client.setUserPrefs
Asynchronous function that creates one or more new user preferences, updates the values of one or more existing user preferences, or both.
WL.Client.setUserPrefs({key1:value1, key2:value2, …}, options)
For each user preference key and value pair provided, the following occurs:
- If a user preference with the specified user key is already defined, the user preference value is updated.
- If there is no user preference defined with the specified key, a new user preference is created with the specified key and value.
If adding the new user preferences would result in the number of user preferences exceeding 100, then no user preferences are added or updated, and the failure handler of the method is called.
The local user preferences in the application are updated only when a successful response is received from the server.
Parameter Description {key1:value1, key2:value2, …} A hash object that contains user preference key and value pairs. The key can be up to 128 characters long. The value can be up to 3072 characters long. options Optional. A standard options object.
Return Value
None.
Parent JavaScript client-side API