GetUserTimeZoneDetails = function ()
{
 
 var ODataPath = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc";
 var filter = "/UserSettingsSet(guid'" + Xrm.Page.context.getUserId() + "')";
 
 var userSettingReq = new XMLHttpRequest();
 userSettingReq.open('GET', ODataPath + filter, false);
 userSettingReq.setRequestHeader("Accept", "application/json");
 userSettingReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
 userSettingReq.send(null);
 var userSetting = this.JSON.parse(userSettingReq.responseText).d;
 var timeZoneBias = 0;
 try
 {
  timeZoneBias = userSetting.TimeZoneBias;
 }
 catch (e)
 {
  timeZoneBias = 0;
 }
 var timeZoneDayLightBias = 0;
 try
 {
  timeZoneDayLightBias = userSetting.TimeZoneDaylightBias;
 }
 catch (e)
 {
  timeZoneDayLightBias = 0;
 }
 
 return [timeZoneBias, timeZoneDayLightBias];
}
The function returns an array containing two elements the timezone bias and timezone daylight bias. The timezonebias is the local time zone adjustment for the user. System calculated based on the time zone selected. The timezonedaylightbias is the local time zone daylight adjustment for the user. System calculated based on the time zone selected.
The SDK has details about other user settings that can be retrieved in the same way as above, see User Settings MetaData
The Dynamics CRM Green Bible
04 April 2013
Get The CRM 2011 Timezone Settings For Current User With JavaScript
03 April 2013
Using The CRM 2011 SOAP Endpoint
Guid contactId = new Guid("[A Valid GUID goes here]");
RetrieveRequest retrieveContact = new RetrieveRequest();
retrieveContact.ColumnSet = new ColumnSet(new string[] { "firstname", "lastname", "emailaddress1" });
retrieveContact.Target = new EntityReference("contact", contactId);
slos.Execute(retrieveContact);
3. Go ahead and run the project, a command prompt appears and you'll need to provide the connection information to the CRM server you want to connect to. After the code has executed you're prompted to "Press (Enter) to exit."
4. A text file has been created in the execution folder called "output.txt", open this with notepad.
var serverUrl = "[CRM Server Url]";
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", serverUrl() + "/XRMServices/2011/Organization.svc/web", false);
xmlhttp.setRequestHeader("Accept", "application/xml, text/xml, */*");
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlhttp.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
var request = "";
request += '';
request += '  ';
request += '    ';
request += '      ';
request += '        ';
request += '          ';
request += '            Target ';
request += '            ';
request += '              e183560d-2680-e211-bc33-005056ba9f90 ';
request += '              contact ';
request += '              ';
request += '              ';
request += '           ';
request += '          ';
request += '            ColumnSet ';
request += '            ';
request += '              false ';
request += '              ';
request += '                firstname ';
request += '                lastname ';
request += '                emailaddress1 ';
request += '               ';
request += '             ';
request += '           ';
request += '         ';
request += '        ';
request += '        Retrieve ';
request += '        ';
request += '     ';
request += '   ';
request += ' ';
xmlhttp.send(request);
GetResponse = function (responseXML, attributename)
{
    var returnValue = "";
    try
    {
  var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = "false";
        xmlDoc.loadXML(responseXML);
        
        var x = xmlDoc.getElementsByTagName("a:KeyValuePairOfstringanyType");
        for (i = 0; i < x.length; i++)
        {
            if (x[i].childNodes[0].text == attributename)
            {
                returnValue = x[i].childNodes[1].text;
                break;
            }
        }
    }
    catch (e)
    {
        returnValue = "";
    }
    return returnValue;
}
13 February 2013
SQL Joins
| 
Table
  A 
 | 
Table
  B 
 | 
| 
User Id | 
Name | 
Login | 
| 
1 | 
Adrian Williams | 
NULL | 
| 
2 | 
Steve Sidwell | 
NULL | 
| 
3 | 
James Harper | 
jharper | 
| 
4 | 
Jamie Cureton | 
jcureton | 
| 
5 | 
Nicky Forster | 
nforster | 
| 
6 | 
Barry Hunter | 
bhunter | 
| 
7 | 
Jimmy Quinn | 
jquinn | 
| 
User Id | 
Name | 
Login | 
| 
3 | 
James Harper | 
jharper | 
| 
4 | 
Jamie Cureton | 
jcureton | 
| 
5 | 
Nicky Forster | 
nforster | 
| 
6 | 
Barry Hunter | 
bhunter | 
| 
7 | 
Jimmy Quinn | 
jquinn | 
| 
NULL | 
NULL | 
scoppell | 
| 
NULL | 
NULL | 
brodgers | 
| 
User Id | 
Name | 
Login | 
| 
1 | 
Adrian Williams | 
NULL | 
| 
2 | 
Steve Sidwell | 
NULL | 
| 
3 | 
James Harper | 
jharper | 
| 
4 | 
Jamie Cureton | 
jcureton | 
| 
5 | 
Nicky Forster | 
nforster | 
| 
6 | 
Barry Hunter | 
bhunter | 
| 
7 | 
Jimmy Quinn | 
jquinn | 
| 
NULL | 
NULL | 
scoppell | 
| 
NULL | 
NULL | 
brodgers | 
| 
User Id | 
Name | 
Login | 
| 
3 | 
James Harper | 
jharper | 
| 
4 | 
Jamie Cureton | 
jcureton | 
| 
5 | 
Nicky Forster | 
nforster | 
| 
6 | 
Barry Hunter | 
bhunter | 
| 
7 | 
Jimmy Quinn | 
jquinn | 
19 July 2012
Checking Which User Account is Accessing a File
Here's a quick how-to to easily find out this information:
1. Download Process Monitor from Technet, unzip it, and run Procmon.exe
2. Select File and uncheck Capture Events
3. Select Edit --> Clear Display
3. Select Filter --> Filter
4. Under "Display entries matching these conditions:" select the following:
- Path
- is
- [path and filename of the file to monitor]
30 March 2012
Entities Not Appearing in Settings After Import
24 November 2011
CRM 4 Entity Type Codes
| Entity name | Value | 
| Account | 1 | 
| AccountLeads | 16 | 
| ActivityMimeAttachment | 1001 | 
| ActivityParty | 135 | 
| ActivityPartyRollupByAccount | 4603 | 
| ActivityPartyRollupByContact | 4604 | 
| ActivityPointer | 4200 | 
| Annotation | 5 | 
| AnnualFiscalCalendar | 2000 | 
| Appointment | 4201 | 
| AttributeMap | 4601 | 
| BulkImport | 4407 | 
| BulkOperation | 4406 | 
| BulkOperationLog | 4405 | 
| BusinessUnit | 10 | 
| BusinessUnitMap | 6 | 
| BusinessUnitNewsArticle | 132 | 
| Calendar | 4003 | 
| CalendarRule | 4004 | 
| Campaign | 4400 | 
| CampaignActivity | 4402 | 
| CampaignActivityItem | 4404 | 
| CampaignItem | 4403 | 
| CampaignResponse | 4401 | 
| Commitment | 4215 | 
| Competitor | 123 | 
| CompetitorAddress | 1004 | 
| CompetitorProduct | 1006 | 
| CompetitorSalesLiterature | 26 | 
| ConstraintBasedGroup | 4007 | 
| Contact | 2 | 
| ContactInvoices | 17 | 
| ContactLeads | 22 | 
| ContactOrders | 19 | 
| ContactQuotes | 18 | 
| Contract | 1010 | 
| ContractDetail | 1011 | 
| ContractTemplate | 2011 | 
| CustomerAddress | 1071 | 
| CustomerOpportunityRole | 4503 | 
| CustomerRelationship | 4502 | 
| Discount | 1013 | 
| DiscountType | 1080 | 
| DocumentIndex | 126 | 
| Email | 4202 | 
| EntityMap | 4600 | 
| Equipment | 4000 | 
| Fax | 4204 | 
| FilterTemplate | 30 | 
| FixedMonthlyFiscalCalendar | 2004 | 
| ImportConfig | 4408 | 
| Incident | 112 | 
| IncidentResolution | 4206 | 
| IntegrationStatus | 3000 | 
| InternalAddress | 1003 | 
| Invoice | 1090 | 
| InvoiceDetail | 1091 | 
| KbArticle | 127 | 
| KbArticleComment | 1082 | 
| KbArticleTemplate | 1016 | 
| Lead | 4 | 
| LeadAddress | 1017 | 
| LeadCompetitors | 24 | 
| LeadProduct | 27 | 
| Letter | 4207 | 
| License | 2027 | 
| List | 4300 | 
| ListMember | 4301 | 
| MonthlyFiscalCalendar | 2003 | 
| Opportunity | 3 | 
| OpportunityClose | 4208 | 
| OpportunityCompetitors | 25 | 
| OpportunityProduct | 1083 | 
| OrderClose | 4209 | 
| Organization | 1019 | 
| OrganizationMap | 7 | 
| OrganizationUI | 1021 | 
| PhoneCall | 4210 | 
| PluginType | 4602 | 
| PriceLevel | 1022 | 
| PrincipalObjectAccess | 11 | 
| Privilege | 1023 | 
| PrivilegeObjectTypeCodes | 31 | 
| Product | 1024 | 
| ProductAssociation | 1025 | 
| ProductPriceLevel | 1026 | 
| ProductSalesLiterature | 21 | 
| ProductSubstitute | 1028 | 
| QuarterlyFiscalCalendar | 2002 | 
| Queue | 2020 | 
| QueueItem | 2029 | 
| Quote | 1084 | 
| QuoteClose | 4211 | 
| QuoteDetail | 1085 | 
| RelationshipRole | 4500 | 
| RelationshipRoleMap | 4501 | 
| Resource | 4002 | 
| ResourceGroup | 4005 | 
| ResourceSpec | 4006 | 
| Role | 1036 | 
| RolePrivileges | 12 | 
| RoleTemplate | 1037 | 
| RoleTemplatePrivileges | 28 | 
| SalesLiterature | 1038 | 
| SalesLiteratureItem | 1070 | 
| SalesOrder | 1088 | 
| SalesOrderDetail | 1089 | 
| SavedQuery | 1039 | 
| SemiAnnualFiscalCalendar | 2001 | 
| Service | 4001 | 
| ServiceAppointment | 4214 | 
| ServiceContractContacts | 20 | 
| Site | 4009 | 
| StatusMap | 1075 | 
| StringMap | 1043 | 
| Subject | 129 | 
| Subscription | 29 | 
| SystemUser | 8 | 
| SystemUserLicenses | 13 | 
| SystemUserPrincipals | 14 | 
| SystemUserRoles | 15 | 
| Task | 4212 | 
| Team | 9 | 
| TeamMembership | 23 | 
| Template | 2010 | 
| Territory | 2013 | 
| UnresolvedAddress | 2012 | 
| UoM | 1055 | 
| UoMSchedule | 1056 | 
| UserFiscalCalendar | 1086 | 
| UserQuery | 4230 | 
| UserSettings | 150 | 
 
