CRM-SDK
Javascript Software Development Kit for Dynamics CRM Web API.
Recommendation
This library was written while Microsoft was still inventing Xrm.WebApi. Nowadays the Xrm Api will do most for you. This library may still be usefull when implementing a SPA, but we recommend using another NPM package to develop your D365 project.
Please have a look at the HSO D365 Command Line Interface. That @hso/d365-cli package also contains a WebApi as wrapper to help you building odata queries in an easier way.
Why another library
There are several SDK's available, so why another one?
- This library does paging for you (using @odata-nextLink to do multiple requests)
- This library always finds correct entitySetName (which is not always: LogicalName + 's')
- This library is promise based
- This library supports modules
- This library supports default WebAPI like other libraries, but also
- This library supports extra Entity abstraction
- This library supports annotations
- This library supports getting OptionSet
- This library supports Webresource uploading/publishing
- This library supports Translation
Table of contents
Install
Install with Npm
$ npm install crm-sdk
Modules
//app.js; WebAPI;
Require
//app.jsvar CRMSDK = ; //umdvar WebAPI = CRMSDKWebAPI; WebAPI;
Install via download
Download latest release and put reference to dist/CRMSDK.js in your index.html.
In example below, the app.js is your own application code. If you only need CRMSDK.WebAPI, you can include WebAPI.js in index.html instead of CRMSDK.js.
In app.js, The WebAPI will be available on window.CRMSDK scope. Example for using WebAPI below:
//app.jsvar WebAPI = windowCRMSDKWebAPI; WebAPI;
WebAPI example
Index.html
app.js
WebAPI ;
Entity abstraction example
Index.html
app.js
var WebAPI = CRMSDKWebAPI; var Entity = CRMSDKEntity; Entity ;
Copyright and license
Code and documentation copyright 2011-2017 Dynamics Software. Code released under the MIT License.