runtime.getCurrentUser().<getPreference(options)> ...
# suitescript
d
runtime.getCurrentUser().getPreference(options) doesn't seem to be able to return any of the user preferences on the 'Restrict View' tab (they all return
null
no matter the selection). I can successfully get the values of other preferences (such as
colortheme
) Has anyone else encountered this or know of a workaround?
m
You might have the same issue but it's worth trying N/config module
d
Thanks, will look into it
m
Yup confirmed that works
message has been deleted
message has been deleted
message has been deleted
d
what a treat to wake up and find this. Cheers Michoel!
Here's the script btw. This is for alerting user when they have a restriction set in their preferences. I've only enabled this for UI context and Admin role. Injects JS to the page using an inline html field (unsupported) during 
beforeLoad
. Then uses the (undoc'd/unsupported) 
showAlertBox()
 and 
hideAlertBox()
 functions to show a warning banner.
m
You can use Form.addPageInitMessage to add a message on before load
Also if you are injecting client script you can
require
N/ui/message
d
FWIW, here it is using
Form.addPageInitMessage()
The only difference is you don't get the benefit of re-showing the message if the user opens the record in a new tab and doesn't navigate to it within the message's duration