npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

crm-sdk

v4.0.9

Published

Javasript Software Development Kit for Microsoft Dynamics CE Web API

Downloads

177

Readme

CRM-SDK

npm npm npm

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
import {WebAPI} from "crm-sdk";

WebAPI.retrieveEntity("account", "475b158c-541c-e511-80d3-3863bb347ba8").then(function (data) {
    //todo logic here
});

Require

//app.js
var CRMSDK = require("crm-sdk"); //umd
var WebAPI = CRMSDK.WebAPI;

WebAPI.retrieveEntity("account", "475b158c-541c-e511-80d3-3863bb347ba8").then(function (data) {
    //todo logic here
});

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.

<html>
<body>
    <script type="text/javascript" src="CRMSDK.js"/>
    <script type="text/javascript" src="app.js"/>
</body>
</html>

In app.js, The WebAPI will be available on window.CRMSDK scope. Example for using WebAPI below:

//app.js
var WebAPI = window.CRMSDK.WebAPI;

WebAPI.retrieveEntity("account", "475b158c-541c-e511-80d3-3863bb347ba8").then(function (data) {
    //todo logic here 
});

WebAPI example

Index.html

<html>
<body>
    <script type="text/javascript" src="WebAPI.js"/>
    <script type="text/javascript" src="app.js"/>
</body>
</html>

app.js

    WebAPI.retrieveEntity("account", "475b158c-541c-e511-80d3-3863bb347ba8")
    .then(function (accountData) {
        WebAPI.updateEntity("account", accountData.accountid, {
            emailaddress1: "[email protected]"
        }).then(function (data) {
            console.log("saved " + data.accountid);
        });
    });

Entity abstraction example

Index.html

<html>
<body>
    <script type="text/javascript" src="CRMSDK.js"/>
    <script type="text/javascript" src="app.js"/>
</body>
</html>

app.js

    var WebAPI = CRMSDK.WebAPI;
    var Entity = CRMSDK.Entity;

    Entity.get("account", "475b158c-541c-e511-80d3-3863bb347ba8")
    .then(function (account) {
        account.emailaddress1 = "[email protected]";
        account.save().then(function () {
            console.log("saved! " + account.accountid);
        });
    });

Copyright and license

Code and documentation copyright 2011-2017 Dynamics Software. Code released under the MIT License.