Friday, 25 July 2008

Calling CRM Webservices via Javascript

I used to be really intimidated by the idea of calling the CRM Webservice via JavaScript, but recently I have had the opportunity (read: didn't have a choice) to use it a lot, both in internal projects and for customer systems. And I realise now how stupid I was in keeping my head in the sand - the JS required to call the webservice does LOOK rather intimidating...but with some help from a fantastic tool on Stunnware (http://www.stunnware.com/crm2/topic.aspx?id=JSWebService), I soon found that, much like myself, it looks a lot worse than it actually is. I've now got a copy of that tool on my desktop set up so that I can quickly switch between the CRM3 and CRM4 versions, and am actually starting to learn to write the XML from scratch (or at least edit it to do different things without having to go through the tool).

There's just so many possibilities that this opens up. Some of the applications we've had for it include:
  • Counters for related records (much like Outlook mail folders) - one caveat is that the more of these counters you want to have, the higher the overhead and therefore the longer the page takes to load
  • Autopopulating fields - for example populating a Customer field with the parent customer of a responsible contact in the Incident entity upon population of the responsible contact
  • Summarising details from other entities on the header of another entity - best explained with a screenshot:
    The circled data is data pulled from 2 different entities, linked by the contact - and it allows our support desk personnel to quickly find out the support level on a given customer's contract.
I'd love to hear of any other applications you might have come up with for this!

No comments: