Skip to content

Read only inquiries into Microsoft Dynamics GP with a SQL Server connection.

License

Notifications You must be signed in to change notification settings

cityssm/node-dynamics-gp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Dynamics GP

npm (scoped) Maintainability codecov Build Status DeepSource

Read only inquiries into Microsoft Dynamics GP using a SQL Server connection.

The purpose of this project to make it easy to incorporate on prem Dynamics GP data into custom business applications. It connects to the underlying SQL Server directly, and returns data in easy-to-use Javascript objects.

Built to validate transactions linked from the City of Sault Ste. Marie's Lot Occupancy System.

Tested with Microsoft Dynamics GP 2018.

Features

  • 🙌 TypeScript types. Easy to get started.

  • 🙌 Temporary caching to reduce database hits and function return times.

  • 🙌 All whitespace trimmed from the end of the char data. Strings are ready to use!

  • 🙌 Consistent and clear field names. For example:

    • PRIMVNDR becomes primaryVendorId
    • PHNUMBR2 becomes phoneNumber2
    • PHONE3 becomes phoneNumber3

Good Use Cases

  • ✔️ Validating a corresponding receipt number was properly entered.

  • ✔️ Displaying the status of an outstanding invoice in a business application.

  • ✔️ Populating contact fields based on customer information.

Not So Good Use Cases

  • ❌ Reporting on all of the inventory items at a specific location. Use a SmartList instead.

  • ❌ Modifying Dynamics GP data. Use Dynamics GP.

Installation

npm install @cityssm/dynamics-gp

Dynamics GP Functions

import { DynamicsGP } from '@cityssm/dynamics-gp'

const gp = new DynamicsGP(mssqlConfig)

const account = await gp.getAccountByAccountIndex(123)

const customer = await gp.getCustomerByCustomerNumber('CUST0001')

const invoice = await gp.getInvoiceByInvoiceNumber('INV00000002')

const item = await gp.getItemByItemNumber('01-0001-00001')

const vendor = await gp.getVendorByVendorId('VEND002')

Diamond-Specific GP Functions

The functions below query Dynamics GP tables with extensions from Diamond Municipal Solutions.

const cashReceipt = await gp.getDiamondCashReceiptByDocumentNumber('123456')

const invoice = await gp.getDiamondExtendedInvoiceByInvoiceNumber(invoiceNumber)

Contributions

Is a field you need missing? An entire table? Create an issue with your request, or better yet, submit a pull request implementing the feature you need!