Back in 2008, while at Ascentium, we posted our internal CrmService.js helper. This JavaScript wrapper makes it easier to make CRM SDK calls from with in JavaScript. Today, I am posting a minor update. It's not a major update, but I wanted to post a more recent version post-Avanade merger. This version has a few minor issues fixed and adds a wrapper for Assign. Here is the new wrapper:
Usage - Assign(new owner id, record id, target (same as the WSDL), optional callback)
Example - service.Assign(strNewOwnerId, strPriceQuoteId, "TargetOwnedAC_pricequote");
You can download it here:
Cheers,
This posting is provided "AS IS" with no warranties, and confers no rights.
I have not tested it with IFD. IFD uses cookie-based authentication, I would assume that if the URL of the CrmService is the same that IE's XMLHTTP object would properly pass the cookie. You might need CrmAuthenticationToken AuthenticationType from "0" (AD) to "2") SPLA aka IFD.
http://msdn.microsoft.com/en-us/library/bb955408.aspx
Regarding Invalid argument, can you tell if this is coming from the server or the client? If it is coming from CRM, then you can turn on CRM Tracing and see the full call stack, you probably have malformed FetchXML (which is easy to mess up).
Posted by: Aaron Elder | 07/25/2010 at 07:35 PM
I'm seeing something odd when trying to use the service.
I'm attempting to use Fetch() from either the form of a salesorder or from ISV.config via a button on the salesorder form toolbar - but neither will work.
I have tried to manipulate the sample html page to use my fetchXml instead of the original sample one and that works just fine, but when I try from both of the stated locations, I get an "Invalid Argument" exception although the code is exactly the same.
I even tried alerting the ServerUrl, Organization and fetchXml before sending it, to make sure it is correct and it all looks good.
So why am I getting this error? Is it some kind of CRM security messing with me?
PS. I do have other js code using the service from ISV.config though not the Fetch() method but creating a new entity and this works just fine.
Any ideas and thoughts on this would be much appreciated.
/Aidal
Posted by: Aidal | 07/22/2010 at 05:48 AM
This is awesome, I use this library a lot! However I was wondering if there was a special way to make it work for IFD?
Cheers
Nick
Posted by: Nick | 07/19/2010 at 05:36 AM