The Zurich release has arrived! Interested in new features and functionalities? Click here for more

gs.getUser().getPreference() does NOT return the "value"

xiaix
Tera Guru

According to This Docs Page, it's saying that gs.getUser().getPreference() returns a "String".  It does not.

So in a widget, I have the following code in the Server Script part:
find_real_file.png

and this in my Client Script:
find_real_file.png

I have a user preference on the sys_user_preference table:

find_real_file.png

 

When I preview the widget, I get this in my console:

find_real_file.png

 

 

Now if I do something insanely ridiculous like this:

find_real_file.png

then fine, I get what I'm looking for.... however, I shouldn't have to do all this to when .getPreference() should be doing this for me.

 

 

1 ACCEPTED SOLUTION

ChrisBurks
Mega Sage

If you're not in a scoped app, if you're creating that preference on your own profile try logging out then back in. The preference should then be applied.

View solution in original post

10 REPLIES 10

Omkar Mone
Mega Sage

Hi 

In your client script, try with c.data.test once.

 

Regards,

Omkar mone

Because this gave me the proper alert - 

find_real_file.png

 

ggg
Giga Guru

GlideUser.getPreference() is for a scoped app and does not exist for global.

are you in a scoped app?

No, I don't create in scoped apps... everything I do is in "Global"