Smart service to change a user's timezone

Is there a Smart Service that can be used to change a user's time zone? We want to allow users to change their time zone settings from Tempo, however, the only way they can do that (as far as I know) is via the apps portal.

Thanks...

OriginalPostID-109201

OriginalPostID-109201

  Discussion posts and replies are publicly visible

Parents
  • There's no out of the box nor Shared Component plug-in to do this; there's one to change the Locale (available for download here in Appian Forum under the "Shared Components" record forum.appian.com/.../all Smart Services) but not for time zone.

    You can build your own using as an example the Create User With i18n smart service that comes with the Personalization Utilities plug-in available for download here in Appian Forum under the "Shared Components" record forum.appian.com/.../all Smart Services; the source code is inside the JAR.

    Here's the relevant snippet that this plug-in uses to set the User's preference:

    UserProfileService ups = ServiceLocator.getUserProfileService(newUserSc);
    ups.setUserPreferences(buildUserPreferences());

    where buildUserPreferences() is defined as

    UserPreferences uPreferences = new UserPreferences();
    uPreferences.setLocale(localeForUser);
    uPreferences.setTimeZone(timezoneForUser);

    More information by looking at the plug-ins source code or the JavaDocs

    forum.appian.com/.../UserPreferences.html


Reply
  • There's no out of the box nor Shared Component plug-in to do this; there's one to change the Locale (available for download here in Appian Forum under the "Shared Components" record forum.appian.com/.../all Smart Services) but not for time zone.

    You can build your own using as an example the Create User With i18n smart service that comes with the Personalization Utilities plug-in available for download here in Appian Forum under the "Shared Components" record forum.appian.com/.../all Smart Services; the source code is inside the JAR.

    Here's the relevant snippet that this plug-in uses to set the User's preference:

    UserProfileService ups = ServiceLocator.getUserProfileService(newUserSc);
    ups.setUserPreferences(buildUserPreferences());

    where buildUserPreferences() is defined as

    UserPreferences uPreferences = new UserPreferences();
    uPreferences.setLocale(localeForUser);
    uPreferences.setTimeZone(timezoneForUser);

    More information by looking at the plug-ins source code or the JavaDocs

    forum.appian.com/.../UserPreferences.html


Children
No Data