Supported Functions

  • createRecord (REST)
  • updateRecord (REST)
  • deleteRecord (REST)
  • retrieve (REST)
  • retrieveMultiple (REST)
  • associate (REST)
  • disassociate (REST)
  • setState (SOAP)
  • fetch (SOAP)
  • execute (SOAP)

Quick Sample

XrmSvcToolkit.createRecord({
    entityName: "Contact",
    entity: {FirstName: "Joe", LastName: "Foo" },
    async: false,
    successCallback: function (result) {
        var contactId = result.ContactId;
        // do the rest stuff
    },
    errorCallback: function (error) {
        alert("There was an error when creating the contact record");
    }
});

Samples

Last edited Dec 4, 2012 at 11:37 AM by georged, version 5

Comments

NateOne Mar 25, 2014 at 5:47 PM 
There is even more samples under Source Code\Samples

Mad_Computerist Sep 29, 2013 at 12:58 PM 
Sample codes for Retrieve, RetrieveMultiple, Create, Update and Delete

http://everythingcrm.net/2013/02/11/xrmsvctoolkit-a-lifesaver-for-complex-javascripts-in-crm2011/

carltoncolter Apr 19, 2013 at 9:06 PM 
The XrmSvcToolkitTest.aspx file contains examples of how to do the other methods. I think it would be helpful if that is noted in the documentation.