Retrieve User Settings such as Time Zone code or Localize Id in MSCRM 2011

Hi,

You may need connected user settings or any user that you have ID.


Please follow below;


 var currentUserSettings = _serviceProxy.RetrieveMultiple(
                new QueryExpression(UserSettings.EntityLogicalName)
                {
                    ColumnSet = new ColumnSet("localeid", "timezonecode"),
                    Criteria = new FilterExpression
                    {
                        Conditions =
                        {
                            new ConditionExpression("systemuserid", ConditionOperator.Equal,UserID)
                        }
                    }
                }).Entities[0].ToEntity();

            //currentUserSettings.LocaleId;
           
currentUserSettings.TimeZoneCode.Value; //get TimeZoneCode

good luck,

Comments

Popular posts from this blog

Complex Query in QueryExpression in Microsoft CRM 2011

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Microsoft Power Apps Portal integration with Dynamics 365 CE On-Premise - Step By Step Guide