CRM 2011 – CRM Online is financially backed to be up 99.9% of the time per month

I read this fact before and then lost where I had seen it.  I find this such an amazing fact/boast/offering that I had to write a blog post about it.

Microsoft gaurantee CRM 2011 Online to be up 99.9% of the time or they give you credit!!  AWESOME

Now for those of you doubting Thomases you can go to the SLA by clicking the link below

Microsoft Dynamics CRM Online Service Level Agreement (“SLA”)

here are the juicy bits from that document

A.                  Monthly Service Level

1.       The Service Level is 99.9%.

2.       The Monthly Uptime Percentage is calculated for a given calendar month using the following formula:

Monthly Uptime Percentage =

Total number of minutes

in a given calendar month

minus

Total number of minutes of Downtime in a given calendar month

Total number of minutes

in a given calendar month

B.                  Service Credits

1.       Should the Service Level fall below 99.9% for a given month, Microsoft will provide a Service Credit as noted in the chart below:

Monthly Uptime Percentage

Service Credit*

                                  < 99.9%                                    25%
                                  < 99%                                    50%
                                  < 95%                                    100%

*Service Credit will be issued against the applicable month’s Subscription Fee paid by Customer for the Service.

I was also slightly amused to read what I call the act of god get out clauses at the bottom.  I am referring them to act of god clauses because on various insurances companies put in act of god clauses to get out of paying anything if a flood happens or your car gets struck by lightening.  The irony being if you believed in god then surely everything is an act of god and the insurance company would have never half to pay, which in itself would show you there is no god meaning the insurance company would have to pay.  Anyway in the Exclusions sections I saw a couple of corkers

D.                  Exclusions

.       Downtime does not include:

a.       The period of time when the Service is not available as a result of Scheduled Downtime; or

b.      The following performance or availability issues that may affect the Service:

i.         Due to factors outside Microsoft’s reasonable control;

iv.         That resulted from actions or inactions of Customer or third parties;

v.         That resulted from actions or inactions by Customer or Customer’s employees, agents, contractors, or vendors, or anyone gaining access to Microsoft’s network by means of Customer’s passwords or equipment.

vii.         Intermittent periods of Downtime that are ten minutes or less in duration

I like the due to factors outside of Microsoft’s control!!!  They surely aren’t admitting they don’t control the whole world, I don’t believe them.  I’m sure this is going to cost Microsoft a load of cash one day but until then it’s quite some boast/level of service and for a lot of companies guaranteeing CRM will always be available (well 99.9% of the time) it’s an important consideration because who can afford to have their CRM system go offline for a few hours.

CRM 2011 – Comparing Microsoft Dynamics CRM vs. Salesforce.com

The funny thing is I have never used Salesforce and I only really know about it by reading article which compare Microsoft Dynamics CRM 2011 with Salesforce.com.  this is an unusual state of affairs but hey I am a signed up certified fan of CRM 2011.

It’s also useful to know some reasons where Microsoft Dynamics CRM 2011 is stronger than Salesforce because you never know when someone might ask you about it, especially a potential customer, so be prepared ahead of time and read this excellent article I found today.

I must have read this article on twitter because I can’t see any hint of it in my netvibes CRM rss feeds.

go here to read the article called compare Microsoft CRM Vs Salesforce.com

the article compares the two offerings but I was interesting in the positive aspects of CRM 2011.   A quick summary is Microsoft are

1.  Cheaper in price for online offering (especially with the current offer)

2.  Microsoft will give you money if you are not online for 99.9% of the month!

3.  You get 5 gigs of data

4.  You get orders to invoice functionality free

5.  Everyone knows how to use Microsoft products like outlook, word, excel etc.

here are two of the more fascinating parts of the document, well I found that fascinating

99.9% Service Level Agreement (SLA)
​Microsoft Dynamics CRM Online offers a financially backed, 99.9% uptime SLA.  Microsoft has consistently delivered an extremely high rate of uptime since the service was launched in April 2008, and we’re accountable to customers if the service does not meet SLA standards.
It’s an incredible statment, to financially back CRM to be up 99.9% of the time every month! Surely some time in the future this is going to cost Microsoft a bit of money, I think I read Amazon recently came unstuck with something similar.
SharePoint sites interoperability
Microsoft Dynamics CRM Online provides license holders with 5GB of storage (as opposed to the 1GB that Salesforce.com offers), allowing businesses to store much more content directly within the product.  Additionally, Microsoft Dynamics CRM integrates well with SharePoint, giving businesses a fast and simple way to leverage their existing investments in Microsoft SharePoint.​

CRM 2011 – How to execute Fetch XML in Javascript

[tweetmeme source=”BenHosk” only_single=false]

The chaps over at Customer Effective blog have written a really interesting blog post this week.  It’s called

Execute Fetch from Javascript in CRM 2011

They actually also wrote an interesting article about why Microsoft buying skype made sense, which you can read here, I found this interesting because I was thinking Microsoft had completely overpaid but then the article  mentions skype have 636 million users, Microsoft paid $8.6 billion and that works out at $14.70 per/user price.  Now that’s not much for each users and you would probably think that skype is going to grow the number of users it has.  You can see Microsoft bundling skype in with Xbox, CRM and office etc.  The last thought I had was Microsoft has money burning a hole in it’s pocket.  The only danger is that someone else/Google could create a skype competitor but then I thought the same about youtube when google brought that and it seems to be working out ok.

Anyway I’m here to talk about Javascript running fetch xml.  The article has some neat javascript, so neat that I read it about 4 times, thinking that is nice and simple (like all good code).

below is the code from the blog.   Brilliant blog entry and if you are interesting in CRM 2011 then you really should subscribe to the Customer Effective Blog because it is one of the best CRM blogs out there, go on go and subscribe here.

FetchUtil.js

var XMLHTTPSUCCESS = 200;
var XMLHTTPREADY = 4;

function FetchUtil(sOrg,sServer)
{
this.org = sOrg;
this.server = sServer;

if (sOrg == null) {
if (typeof(ORG_UNIQUE_NAME) != “undefined”) {
this.org = ORG_UNIQUE_NAME;
}
}

if (sServer == null){
this.server = window.location.protocol + “//” + window.location.host;
}
}

FetchUtil.prototype._ExecuteRequest = function(sXml, sMessage, fInternalCallback, fUserCallback)
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.open(“POST”, this.server + “/XRMServices/2011/Organization.svc/web”,(fUserCallback!=null));
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“);

if (fUserCallback!=null)
{
//asynchronous: register callback function, then send the request.
var crmServiceObject = this;
xmlhttp.onreadystatechange = function(){ fInternalCallback.call(crmServiceObject,xmlhttp,fUserCallback) };
xmlhttp.send(sXml);
}
else
{
//synchronous: send request, then call the callback function directly
xmlhttp.send(sXml);
return fInternalCallback.call(this,xmlhttp,null);
}
}

FetchUtil.prototype._HandleErrors = function(xmlhttp)
{
/// <summary>(private) Handles xmlhttp errors</summary>
if (xmlhttp.status != XMLHTTPSUCCESS) {
var sError = “Error: ” + xmlhttp.responseText + ” ” + xmlhttp.statusText;
alert(sError);
return true;
} else {
return false;
}
}

FetchUtil.prototype.Fetch = function(sFetchXml, fCallback)
{
/// <summary>Execute a FetchXml request. (result is the response XML)</summary>
/// <param name=”sFetchXml”>fetchxml string</param>
/// <param name=”fCallback” optional=”true” type=”function”>(Optional) Async callback function if specified. If left null, function is synchronous </param>
var request = “<s:Envelope xmlns:s=\”http://schemas.xmlsoap.org/soap/envelope/\“>”;
request += “<s:Body>”;

request += ‘<Execute xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts/Services“>’ +
‘<request i:type=”b:RetrieveMultipleRequest” ‘ +
‘ xmlns:b=”http://schemas.microsoft.com/xrm/2011/Contracts“‘ +
‘ xmlns:i=”http://www.w3.org/2001/XMLSchema-instance“>’ +
‘<b:Parameters xmlns:c=”http://schemas.datacontract.org/2004/07/System.Collections.Generic“>’ +
‘<b:KeyValuePairOfstringanyType>’ +
‘<c:key>Query</c:key>’ +
‘<c:value i:type=”b:FetchExpression”>’ +
‘<b:Query>’;

request += CrmEncodeDecode.CrmXmlEncode(sFetchXml);

request += ‘</b:Query>’ +
‘</c:value>’ +
‘</b:KeyValuePairOfstringanyType>’ +
‘</b:Parameters>’ +
‘<b:RequestId i:nil=”true”/>’ +
‘<b:RequestName>RetrieveMultiple</b:RequestName>’ +
‘</request>’ +
‘</Execute>’;

request += ‘</s:Body></s:Envelope>’;

return this._ExecuteRequest(request,”Fetch”, this._FetchCallback, fCallback);
}

FetchUtil.prototype._FetchCallback = function(xmlhttp,callback)
{
///<summary>(private) Fetch message callback.</summary>
//xmlhttp must be completed
if (xmlhttp.readyState != XMLHTTPREADY)
{
return;
}

//check for server errors
if (this._HandleErrors(xmlhttp))
{
return;
}

var xmlReturn = xmlhttp.responseXML.xml;
xmlReturn = xmlReturn.replace(/</g, ‘&lt;’);
xmlReturn = xmlReturn.replace(/>/g, ‘&gt;’);

results = xmlReturn;

//return entity id if sync, or call user callback func if async
if (callback != null)
{
callback(results);
}
else
{
return results;
}
}

fetchExample.htm

<html>
<head>
<title>Fetch 2011 JavaScript Example</title>
<link rel=”stylesheet” type=”text/css” href=”/_common/styles/theme.css.aspx” />
<link rel=”stylesheet” type=”text/css” href=”/_common/styles/global.css.aspx” />
<link rel=”stylesheet” type=”text/css” href=”/_common/styles/fonts.css.aspx” />
<link rel=”stylesheet” type=”text/css” href=”/_common/styles/Dialogs.css.aspx” />

<script src=”ClientGlobalContext.js.aspx”></script>
<script src=”{pub}_FetchUtil.js”></script>

<script type=”text/javascript”>

var _oService;
var _sOrgName = “”;
var _sServerUrl = “https://{org}.api.crm.dynamics.com”;
function executeFetchCommand()
{

var sFetch = document.getElementById(‘txtFetch’).value;
_oService = new FetchUtil(_sOrgName, _sServerUrl);
var oEntity = _oService.Fetch(sFetch, myCallBack);
}

function myCallBack(results){
var sOut = “”;
sOut += “<b>XML Response</b><br />”;
sOut += results;
document.getElementById(‘dvData’).innerHTML = sOut;
}

</script>

</head>
<body>
<table style=”width: 100%; height: 100%;” cellspacing=”0″ cellpadding=”0″ border=”0″>
<tr>
<td id=”tdDialogHeader”>
<div id=”divTitle”>Executing Fetch from JavaScript in CRM 2011</div>
<div id=”divInstructions”>Enter some FetchXML to be executed against your CRM environment</div>
</td>
</tr>
<tr>
<td style=”height: 100%;”>
<div style=”padding: 14px;”>
<label>Fetch Command</label><br />
<textarea id=”txtFetch” rows=”8″ width=”100%” cols=”100″ ></textarea><br />
<input type=”Submit” value=”Fetch” onClick=”javascript:executeFetchCommand();” style=”width:100px;height:24px;”>
<div id=’dvData’ style=”width: 100%; height: 100%;”></div>
</div>
</td>
</tr>
<tr>
<td id=”tdDialogFooter”>
<table cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”100%”></td>
<td>&nbsp;<button onclick=”window.close();”>Done</button></td>
</tr>
</table>
</td>
</tr>
</table>

</body>
</html>

Now that we have our JavaScript utility and our Fetch example, we need to do a few things.

  1. We need a solution to put these two files into (feel free to add it to an existing solution or create one named whatever you like).
  2. Let’s now import the FetchUtil.js file and publish. Take note of the Publisher Prefix (the letters in front of the name).
  3. We now need to modify the fetchExample.htm file to point to this FetchUtil.js by replacing the {pub} with your Publisher Prefix (ex. “new_FetchUtil.js”).
  4. We also need to modify the _sServerUrl and change the {org} to the appropriate organization abbreviation. If you are using the onsite, you will need to change the entire URL to match accordingly.
  5. Finally, let’s upload the fetchExample.htm file and publish.

This should now bring you to a super fancy screen to paste some Fetch into.

image

Well there you have it. The next step is to parse the XML with jQuery, RegEx, traversing the nodes, or however you prefer. Hope you enjoy!

CRM 2011 – Tool – CRM 2011 Autonumbering Solution

I have already written my own version of an auto numbering plugin but today I saw that someone has created a codeplex project.

I had to rewrite mine because initially did using LINQ only to find you can’t use LINQ on CRM 2011 Online and then had to rewrite it using QueryExpression.

Looking at this plugin it seems almost identical (there is only so much functionality an auto numbering system needs) except my version has a pad facility because the users wanted to have the counter 6 digits long etc.

Go here and download the project if you want some auto numbering functionality in CRM 2011.

here is a brief description from codeplex

Project Description
This is a solution for crm 2011 (hosted/on-premise) for autonumbering the configurated entity.

As an unmanaged solution, files included are:
1. A plugin for sequence generation : CRM.Plugin.SequenceGenerator
2. A custom entity for configuration: Counter
3. Three icons for the custom entity.

Gotcha – Visual Studio must be run as Administrator in windows 7

This has caught me out a few times.  The first time you experience the problem you will notice that the application which was working fine before suddenly is starting to throw unusual errors when you try to run/debug it.

Windows 7 has an annoying feature where you have to specify applications to run as Administrator.  You can set application to always run as Administrator if you go edit the properties of the shortcut or the exe itself and then go to Advanced and select Run as Administrator.

This is fine if you open Visual Studio using the direct shortcut to the program but what happens if you open a project file?  What happens if the project file uses the Visual Studio version selector.

Yes you have guessed it, one day the application was working fine when I opened Visual studio 2010 and then selected the project from within there.

the next day I was getting unusual errors and after debugging for ages I found that it was because I had opened the project directly, which used the visual studio version program which then choose Visual Studio 2010 but it didn’t run it as Administrator.

I tried changing the properties of Visual Studio program Version Selector but it then wouldn’t open the project at all.

So my advice is when you open any projects or sln files in Visual Studio 2010 on windows 7, open Visual Studio first and then select the project.