How to retrieve user regional settings like language/time zone/calender

How to retrieve user regional settings like language/time zone/calender

user() does not have the regional propertiescurrently & usertimezone() - If the application is configured to override user preferences, returns the site primary timezone

Thanks,
Abhinav

OriginalPostID-166567

OriginalPostID-166567

  Discussion posts and replies are publicly visible

Parents
  • Out of the box we only have these two:

    forum.appian.com/.../Scripting_Functions.html
    forum.appian.com/.../Scripting_Functions.html

    If you have enabled "Override user preferences" they'll return the site default settings. That's the expected behavior. At this point you can't retrieve their preferences because by default they are changed to use the default ones. This can even be seen if the user tries to change her preference, she won't be able to do so and it will display the default ones.

    If you want to retrieve the user's actual preferences you'll need to create your own custom function:

    ServiceContext sc_ = ServiceContextFactory.getServiceContext(username);
    UserProfileService usps = ServiceLocator.getUserProfileService(sc_);
    UserPreferences upreferencs = usps.getUserPreferences();
    return upreferencs.getLocale();
Reply
  • Out of the box we only have these two:

    forum.appian.com/.../Scripting_Functions.html
    forum.appian.com/.../Scripting_Functions.html

    If you have enabled "Override user preferences" they'll return the site default settings. That's the expected behavior. At this point you can't retrieve their preferences because by default they are changed to use the default ones. This can even be seen if the user tries to change her preference, she won't be able to do so and it will display the default ones.

    If you want to retrieve the user's actual preferences you'll need to create your own custom function:

    ServiceContext sc_ = ServiceContextFactory.getServiceContext(username);
    UserProfileService usps = ServiceLocator.getUserProfileService(sc_);
    UserPreferences upreferencs = usps.getUserPreferences();
    return upreferencs.getLocale();
Children
No Data