Impulz Technologies LLC

Menu
  • Home
  • Products
    • IMPULZ Positive Pay
    • IMPULZ Product unlock
  • Solutions
    • Microsoft Dynamics 365 Finance & Supply Chain Management
    • Microsoft Azure
    • Microsoft Power Platform
      • Power BI
      • Power Apps
  • Services
    • Application Support And Maintenance
    • Azure Cloud Services
    • ISV Development
    • Project Resources
  • About Us
  • Blog
  • Clients
  • Contact Us

Impulz Technologies LLC

NodeJS + Dynamics 365 Finance and Supply Chain – A great combo?

  • Home
  • Blog
  • Dynamics 365
  • NodeJS + Dynamics 365 Finance and Supply Chain – A great combo?
  • July 17, 2023July 18, 2023
  • Ahmad Hussain
Dynamics 365
Dynamics 365

Dynamics 365 integration projects can be diffcult. In this multipart series of blog posts, we are going to discuss on how to connect the NodeJS application to Microsoft Dynamics 365 application.

Problem Statement

IMPULZ team was doing a master data and sales integration between the third-party cloud POS solution and the Microsoft Dynamics 365 Finance and Supply chain management application. There were discrepancies in the sales numbers between the two systems which needs further investigation. Third-party system was on cloud and D365 data needs to be verified from the UAT instance.

 Solution

Fetch the data from both the systems using the REST APIs and dump the data in a single analytical relational database which was a local SQL Server Express database in our case. Our team can now use the standard SQL queries to analyse the sales numbers mismatch.

Our Technology Stack

For this we have to develop a small command-line utility to fetch the data through API using a standard technologies like .Net, Python etc. Being a Microsoft partner, .Net should be the very obvious choice but instead we opted for NodeJS. Why? A simple reason is the simplicity of JavaScript when compared to C# and its ability to handle JSON objects seamlessly (for an obvious reason – after all JSON is JavaScript Object Notation).

To dump the database into a SQL Server database we have used the Sequelize as an ORM, again it is a simple, lightweight tool with excellent command-line tooling.

So this was our tech stack:

  1. Node – latest version as a JavaScript runtime outside the browser context.
  2. JavaScript
  3. AXIOS – Node popular package for the API calling.
  4. SQL Server – for storage.
  5. Sequelize – an ORM to dump the data into the local SQL Server Database.

My Two Cents!

One of the task was to do in this utility was to do an Azure authentication and when I compared the code to do this in C#, it was a like an hell of an object hierarchy we need to deal with. Yes same old ‘using’ and object encapsulation in multi-layer hierarchies.

In JS it was literally a single endpoint calling to generate the Azure token.

First you need to register an Azure client application

Microsoft Dynamics 365 Finance and Supply chain app being an Azure resource requires a client application to be registered first. Registering a client application is simple and requires similar steps like we did in one of our earlier blog post. The only steps which differ are:

  1. You don’t have to specify callback URL because we are using the Azure client credentials flow here.
  2. The API permissions required differs from our previous blog post. You have to search for ‘Dynamics ERP’ from the permissions list and then select one of the appropriate permission from the list under ‘Delegated permissions’. We had selected ‘AX.FullAccess’ in our case. It should be as restricted as possible due to security constraints.

 

3. Since it is a app-to-app calling that’s why you also need to create the client secret by clicking the following link as shown below. Copy the generated secret securely. This secret is needed to generate token from the Azure Active Directory.

Registering a user in Dynamics 365

In your Dynamics client, go to System AdministrationàSetupàAzure Active Directory applications. Add a new record and paste the client id/application id copied from the Azure portal. Give it a meaningful name and assign the user who is going to impersonate the calls coming from the app. More restrictive, the better it will be.

What’s Next?

You need to develop a Node app on your own – 😊. Just kidding! In the next blog post we are going to explain the code main components and optionally we are going to publish the code in a GitHub public repo. Until then, stay tuned!

Now some marketing stuff – if you in need of any help in your integration projects, struggling with the on-going implementation project, you are a Microsoft partner and looking for an experienced Dynamics 365 consultants or you just want to say ‘Hi’, reach us at info@impulztech.com or 630-540-6302 Mon-Fri between 9 am – 4 pm central time.

Posted in Dynamics 365

Recent Posts

  • Optimizing Azure Workloads: Automate VM Startup and Shutdown
  • Landed Cost – Auto Cost Setup in Microsoft D365 Finance and Supply Chain
  • Big Data Capabilities of Azure Synapse, Databricks, and Data Factory
  • Fix Database Synchronization Errors in Microsoft Dynamics AX 2012
  • Dynamics 365 Finance and Supply Chain: Implement budget check via custom logic

Recent Comments

No comments to show.

Archives

  • April 2024
  • December 2023
  • November 2023
  • October 2023
  • July 2023
  • April 2023
  • February 2023
  • January 2023
  • October 2022
  • September 2022
  • August 2022
  • July 2022

Categories

  • Business
  • Dynamics 365
  • Dynamics 365 Finance and Supply Chain
  • Dynamics AX 2012
  • Introductions
  • Microsoft Azure
  • Microsoft Dataverse
  • Microsoft Power Platform
  • New Technologies
  • Power BI
  • Uncategorized

Latest Post

  • Optimizing Azure Workloads: Automate VM Startup and Shutdown
  • Landed Cost – Auto Cost Setup in Microsoft D365 Finance and Supply Chain
  • Big Data Capabilities of Azure Synapse, Databricks, and Data Factory
  • Fix Database Synchronization Errors in Microsoft Dynamics AX 2012
  • Dynamics 365 Finance and Supply Chain: Implement budget check via custom logic

Tags

Auto Cost Automation Ax2012 Azure Azure AD Azure Databricks Azure Data Factory Azure Synapse Cost Accounting D365 D365 code management D365 FO Azure DevOps Dataverse Development DevOps Duty Dynamics 365 Finanace and Operations development VM Dynamics 365 Finance and Operations Dynamics 365 Finance and Supply Chain Dynamics 365 FO Security Dynamics 365 with git Dynamics Lifecycle Services Export Freight Full Sync errors Import Item Cost Allocation Landed Cost Lifecycle Services Microsoft Azure Microsoft Dataverse Microsoft dynamics Microsoft Dynamics 365 Microsoft Dynamics 365 Commerce Microsoft Dynamics 365 Finance and Operations Microsoft Dynamics 365 version control Model Driven Apps Power Apps Power Platform Shipment SQL Error Transportation Voyages Web APIs XDS Framework
© Impulz Technologies - All right reserved.