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
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
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.
Got it!
new QueryExpression("systemuser")
The systemuser should be "usersettings"
it's now working! :)
Thanks everyone!
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)
}
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...
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!
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.
Then you can set your personal Timezone on General tab.
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
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
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.
André Arnaud de Cal...
292,494
Super User 2025 Season 1
Martin Dráb
231,305
Most Valuable Professional
nmaenpaa
101,156