Tuesday, April 10, 2012

Accessing Microsoft CRM 4.0 data using web services

A couple of days ago I wanted to write a plugin for Excel 2010 which would allow me to do lookups in Microsoft CRM 4.0 for adding extra information to a worksheet.

I was pleasantly surprised at how easy this was. Microsoft CRM 4.0 exposes all of its data through the CrmService web service - http://[server:port]/mscrmservices/2007/crmservice.asmx which exposes a number of interesting methods ( see CrmService Common methods)  of which one is the CrmService.Fetch method which allows for retrieving CRM entities in XML based on a specified XML query syntax which is called FetchXML.

The only tricky part is creating this FetchXML but there are a number of  tools that you can use to actually generate this FetchXML:

There is however another simpler method – just open CRM 4.0 and use the Advanced Option to create a new search. Click CTRL+N to open a new window with the address bar visible – now build your query and click Find. When the search results screen appears – paste the following in the address bar - javascript:alert(resultRender.FetchXml.value);  and hit enter

Tags van Technorati: ,,,

1 comment:

Microsoft Dynamics CRM said...

I'll try thn will give u feedback on it..