Programmatically setting user preferences, which are being ignored.

geoffcox
Giga Guru

I have a requirement for a UI action to toggle back and forth between views of the Incident form. It's easy enough to redirect the user to a particular view, but the user interface is not remembering the setting as the user's preferred view. So I programmatically insert records into the user preference table, but the system is ignoring these preferences, until I logout and log back in. Are the user preferences also being maintained in the session data somehow?

1 ACCEPTED SOLUTION

Slava Savitsky
Giga Sage

Syntax for client-side scripts is almost the same but without the gs,getUser() part:



setPreference('user_preference_name', 'user_preference_value');


View solution in original post

10 REPLIES 10

Slava Savitsky
Giga Sage

Try this code. It will do all the heavy lifting in the background.



gs.getUser().setPreference('user_preference_name', 'user_preference_value');


Slava Savitsky
Giga Sage

Syntax for client-side scripts is almost the same but without the gs,getUser() part:



setPreference('user_preference_name', 'user_preference_value');


The client side method does work! Thanks very much.


Glad to hear it solved your issue!


How to set user preference for perticular group?