Skip to main content

DYNXCRM Library

Overview

The DYNXCRM Library is an importable library containing functions to connect, authenticate, and interact with Microsoft's Dynamics 365 CRM. This library is used in the Microsoft Dynamics 365 CRM Adapter.

Import the DYNXCRM library into your project. Typically only the DYNXCRMclient module needs to be required in order to create the client and access the API methods.

require "DYNXCRM.DYNXCRMclient"   

How it works:

Use the Translator's built in help to review how to use each function:

DYNXCRMclient - sets up the adapter framework

Creates the DYNXCRM adapter framework, adding the various method modules to a metatable and storing the configurations added to the custom fields.

DYNXCRMcreateFetchXml

Create a query SOAP XML from a given fetch XML template.

DYNXCRMcreateUpdateXml

Create an update SOAP XML from a given set of inputs and entity details.

DYNXCRMcustom

Performs a custom POST API call to Microsoft Dynamics 365 CRM.

DYNXCRMformatDate

Creates a formatted date string for entry into the CRM, either from a given date value or the current date.

DYNXCRMget

Fetches entities from the CRM and returns the XML-derived attributes as Lua tables.

DYNXCRMgetHeader

Generates the SOAP header with the necessary authentication tokens.

DYNXCRMupdate

Updates an entity in Microsoft Dynamics 365 CRM.

Additional utility functions:

DYNXCRMgetUTC

Converts the given unix epoch time to UTC or provides the current Unix epoch time in UTC.

DYNXCRMsetFetchConditions

Takes a raw fetch XML and updates filter conditions in the XML

DYNXCRMaddAttribute

Create a XML snippet (a:KeyValuePairOfstringanyType) for an attribute.

DYNXCRMaddOptionSetValue

Create a XML snippet (a:KeyValuePairOfstringanyType) for an optionSetValue attribute.

DYNXCRMaddRelAttribute

Create a XML snippet (a:KeyValuePairOfstringanyType) for a related entity.