SkillAgentSearch skills...

DynamicsWebApi

DynamicsWebApi is a Microsoft Dataverse Web API helper library for JavaScript & TypeScript

Install / Use

/learn @AleksandrRogov/DynamicsWebApi

README

DynamicsWebApi for Microsoft Dataverse Web API / Microsoft Power Pages / Microsoft Dynamics 365 (CRM)

GitHub Workflow Status Coveralls npm npm

DynamicsWebApi is a Microsoft Dataverse Web API helper library written in Typescript.

Compatible with: Microsoft Dataverse; Microsoft Dynamics 365: Customer Service, Field Service, Marketing, Project Operations, Talents, Sales and any model-driven application built on Microsoft Power Apps platform. As well as Microsoft Dynamics 365 CE (online), Microsoft Dynamics 365 CE (on-premises), Microsoft Dynamics CRM 2016, Microsoft Dynamics CRM Online.

This documentation is for version 2.x. If you are working with version 1.x, please check this instead.

If you want to upgrade from v1 - v2 breaking changes are here. List of new features in v2 is here.

Please check DynamicsWebApi Wiki where you will find documentation to DynamicsWebApi API and more.

Changelog can be found here.

Browser-compiled script and type definitions can be found in a v2 dist folder.

Main Features

  • Microsoft Dataverse Search API. Access the full power of its Search (Query), Suggestion and Autocomplete capabilities.
  • Batch Requests. Convert all requests into a Batch operation with two lines of code.
  • Simplicity and Automation. Such as automated paging, big file downloading/uploading in chunks of data, automated conversion of requests with long URLs into a Batch Request in the background and more!
  • CRUD operations. Including Fetch XML, Actions and Functions in Microsoft Dataverse Web API.
  • Table Definitions (Entity Metadata). Query and modify Table, Column, Choice (Option Set) and Relationship definitions.
  • File Fields. Upload, Download and Delete data stored in the File Fields.
  • Abort Signal and Abort Controller (Browser and Node.js 15+). Abort requests when they are no longer need to be completed.
  • Node.js and a Browser support.
  • Proxy Configuration support.
  • Background Operations support. v2.3.0+
  • Works with Microsoft Power Pages (aka Microsoft Portal). v2.1.0+

I maintain this project in my free time and it takes a considerable amount of time to make sure that the library has all new features, gets improved and all raised tickets have been answered and fixed in a short amount of time. If you feel that this project has saved your time and you would like to support it, then please feel free to sponsor it through GitHub Sponsors.

Also, please check suggestions and contributions section to learn more about how you can help to improve the library.


Terminology

Check out Dataverse Terminology. Microsoft has done some changes in the namings of the objects and components of D365 and since DynamicsWebApi has been developing for many years there may be conflicting naming, such as: createEntity - which right now means "Create a Table Definition". Dataverse SDK terminology is what the library has been based on. I have no plans on changing that (except in documentation), mainly because Microsoft may change the namings again in the future which will lead to naming issues ...again.

[!NOTE] "Dynamics 365" in this readme refers to Microsoft Dataverse (formerly known as Microsoft Common Data Service) / Microsoft Dynamics 365 Customer Engagement / Micorosft Dynamics CRM. NOT Microsoft Dynamics 365 Finance and Operations.

Table of Contents

v2 breaking changes are here. List of new features in v2 is here.

Getting Started

Dynamics 365 Web Resource

To use DynamicsWebApi inside Dynamics 365 you need to download a browser version of the library, it can be found in v2 dist folder.

Upload a script as a JavaScript Web Resource, add it to a table form or reference it in the HTML Web Resource and then initialize the main object:

//By default DynamicsWebApi makes calls to 
//Web API v9.2 and Search API v1.0
const dynamicsWebApi = new DynamicsWebApi();

const response = await dynamicsWebApi.callFunction("WhoAmI");
Xrm.Navigation.openAlertDialog({ text: `Hello Dynamics 365! My id is: ${response.UserId}` });

Microsoft Power Pages (Microsoft Portal)

v.2.1.0+

There are two ways to include DynamicsWebApi in your portal: upload as a Web File or use CDN, such as unpkg.

It is possible to upload the library as a Web File in Microsoft Power Pages. Usually, the .js extensions are forbidden to upload but it is still possible to do, here's a workaround.

Once the web file is uploaded, it can be included in a template, a page or a form the following way:

<script type="text/javascript" src="~/dynamicsWebApi.min.js"></script>

With CDN, it is a bit easier: no need to create and upload a web file - just include the script in your

View on GitHub
GitHub Stars307
CategorySales
Updated6d ago
Forks66

Languages

TypeScript

Security Score

100/100

Audited on Mar 26, 2026

No findings