Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Is there a way for me to get a User record's timezone settings?

(0) ShareShare
ReportReport
Posted on by 1,260

Is there an out of the box field for User records which determines the Timezone set on their personal settings?

Let say I am User A and I would like to retrieve User B's timezone settings.

Any ideas?

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi Marjoorie,

    It would be same for Plugin/ custom workflow activity. The error you are gettign is because you have used system user entity, you need to add "usersetting" entity

    Here is the sample code

    ============

    var queryUserTimezone = new QueryExpression("usersettings")

                   {

                       ColumnSet = new ColumnSet("localeid", "timezonecode"),

                       Criteria = new FilterExpression

                       {

                           Conditions =

                           {

                               new ConditionExpression("systemuserid", ConditionOperator.Equal, systemUserId)

                           }

                       }

                   };

                   var results = service.RetrieveMultiple(queryUserTimezone);

                   if (results != null && results.Entities.Count > 0)

                   {

                       var timeZoneCode = results.Entities[0]["timezonecode"];

                       Console.WriteLine(timeZoneCode);

                   }

    ===============

    Hope this helps.

  • MRVIX Profile Picture
    MRVIX 1,260 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Got it!

    new QueryExpression("systemuser")

    The systemuser should be "usersettings"

    it's now working! :)

    Thanks everyone!

  • MRVIX Profile Picture
    MRVIX 1,260 on at
    RE: Is there a way for me to get a User record's timezone settings?

    To add,

    for me to be able to get the ID of the User in the Owner field I changed the ConditionExpression to this,

    Conditions =

                  {

                       new ConditionExpression("systemuserid", ConditionOperator.Equal, userId)

                  }

  • MRVIX Profile Picture
    MRVIX 1,260 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi Goutam,

    Seems like it is working using a Plugin and not in my Custom Workflow. Any thoughts?

    I used this, 

    new QueryExpression("systemuser")
    {
    ColumnSet = new ColumnSet("localeid", "timezonecode"),

    Criteria = new FilterExpression
    {
    Conditions =
    {
    new ConditionExpression("systemuserid", ConditionOperator.EqualUserId)
    }
    }
    }).Entities[0].ToEntity<Entity>();

    Here's what I'm getting...

    2018_2D00_09_2D00_28_5F00_14h11_5F00_24.png

  • MRVIX Profile Picture
    MRVIX 1,260 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi All,

    Thank you for all your response.

    The reason I'm asking is that using a Custom Workflow Activity, I would like to get the Owner of the record(WHICH IS NOT THE CURRENT USER) and capture the timezone set to that specific User.

    Any ideas? Thanks!

  • LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi Marjorie,

    Each user can modify his own Timezone in personal options.

    You can click the gear on the right side of the navigation bar and select options

    WeChat-Screenshot_5F00_20180928124618.png

    Then you can set your personal Timezone on General tab.

    WeChat-Screenshot_5F00_20180928124618.png

    But there is no OOB features to set other user's Timezone.

    May be you can achieve this by custom tools.

    Hope it helps.

    Best Regards

    Leo

  • Suggested answer
    PranavShroti Profile Picture
    PranavShroti 4,510 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi Marjorie,

    you can use a utility XrmToolBox (https://www.xrmtoolbox.com/)

    The utility allows you to quickly and easily update/retrieve system user settings for multiple users from one central location. System Administrators can select a group of users and set attributes such as the default pane, language time zone, default calendar, records per pages etc. Of particular interest are the Email Settings, where you can specify which emails to track and whether to automatically create records in CRM.

    Download and extract the toolkit from http://www.xrmtoolbox.com/

    Connect to your CRM organization using the Connection page

    Once connected you will be able to browse the many tools available to you. Locate the User Settings Utility.

    Regards,

    Pranav

    If found useful, please mark the answer as verified

  • Verified answer
    gdas Profile Picture
    gdas 50,089 on at
    RE: Is there a way for me to get a User record's timezone settings?

    Hi Marjorie,

    You can retrieve the information by passing GUID in the  UserSettings entity -

    If you want to write server side code check here -

    docs.microsoft.com/.../sample-retrieve-time-zone-information

    For client side check here -

    crmgreenbible.blogspot.com/.../get-crm-2011-timezone-settings-for.html

    Although above script is old way to retrieve information but you can replace with  new web api.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans