# MS Dynamics plugin

Integrates Microsoft Dynamics 365 (opens new window) CRM with the Epona provisioning service. The plugin periodically syncs matters, accounts, and contacts from Dynamics 365 to SharePoint.

DLL: Epona.MSDynamics.dll

# What it does

  • Matter sync — reads opportunities or cases from Dynamics 365 and creates or updates corresponding records in SharePoint.
  • Account/Customer sync — reads accounts and creates client records in SharePoint.
  • Contact sync — reads contacts and associates them with matters or clients.
  • Field mapping — maps Dynamics 365 entity fields to SharePoint properties.

# Deployment

  1. Copy Epona.MSDynamics.dll to the service's bin directory.
  2. Restart the provisioning service.
  3. Open the Configurator, select the relevant SharepointCfg, and configure the MS Dynamics section that now appears in the property grid.

# Configuration reference

# Connection settings

# Name

Type: string | Default: MS Dynamics

Display name for this plugin configuration.

# Disabled

Type: boolean | Default: false

Set to true to disable this configuration without removing it.

# Url

Type: string

Base URL of your Dynamics 365 organization. Example: https://organization.crm.dynamics.com/.

# ClientId

Type: string

Azure AD application client ID for OAuth authentication.

# ClientSecret

Type: string

Azure AD client secret. Stored encrypted. Managed via Secrets manager.

# Scheduling

# IntervalInMinutes

Type: integer

How often the sync job runs.

# StartTime

Type: TimeSpan

Earliest time of day the job may run. Leave empty to run at any time.

# EndTime

Type: TimeSpan

Latest time of day the job may run. Leave empty to run at any time.

# Entity configuration

# EntityType

Type: string

Dynamics 365 entity to sync: opportunity, case, or incident.

# MatterCodeField

Type: string

Entity field containing the matter code.

# MatterNameField

Type: string

Entity field containing the matter name.

# AccountCodeField

Type: string

Entity field containing the account/customer code.

# AccountNameField

Type: string

Entity field containing the account name.

# Field mapping

# MatterFieldMapping

Type: string

Maps Dynamics entity fields to SharePoint. Syntax: sharepointField=dynamicsField;.

# AccountFieldMapping

Type: string

Maps Dynamics account fields to SharePoint. Same syntax.

# Filtering

# MatterFilter

Type: string

OData filter to apply when reading matters. Example: statuscode eq 1.

# AccountFilter

Type: string

OData filter to apply when reading accounts.

# Post handler

The post handler writes a value back to Dynamics 365 after a matter is provisioned in SharePoint. It sends a PATCH request to a specified Dynamics endpoint to record the SharePoint site URL (or any other value) against the corresponding Dynamics matter.

All post handler keys are optional. The handler only runs when SaveDataInDynamics is true and all required keys are set.

# SaveDataInDynamics

Type: boolean | Default: false

Set to true to enable the post handler. When false, no data is written back to Dynamics after provisioning.

# DynamicsSaveDataEndpoint

Type: string

The Dynamics 365 entity set endpoint to PATCH. Example: si_matters, incidents, si_investmentaccounts.

# DynamicsSaveDataProperty

Type: string

The Dynamics 365 field (property name) to update on the matched record. Example: dms_url, DMSforLegalUrl.

# SharepointMatterIdProperty

Type: string

The SharePoint matter property that holds the Dynamics 365 record ID (GUID) used to identify which record to update. Example: MSDynamicsMatterId.

# SharepointMatterProperty

Type: string

Either a SharePoint matter property name whose value is written to Dynamics, or a literal string that may contain {placeholder} tokens. Example: URL (reads the URL property), or https://contoso.sharepoint.com/sites/{MatterCode} (constructs a URL from matter tokens).

# PostHandlerCustomMessageHeaders

Type: string

Optional custom HTTP headers to include in the PATCH request. Use Key=Value pairs separated by semicolons.

If-Match=*
If-Match=*;Content-Type=application/json

Use If-Match: * when the Dynamics endpoint requires an unconditional update (common for certain Business Central and Dynamics 365 API versions).

# Debugging

# Debug

Type: boolean | Default: false

Enables verbose debug logging.

# Example configuration

Property Example value
Name MS Dynamics
Url https://contoso.crm.dynamics.com/
ClientId your-client-id
EntityType opportunity
MatterCodeField name
MatterNameField description
AccountCodeField accountid
AccountNameField name
MatterFieldMapping Amount=estimatedvalue;Stage=stageid;Owner=ownerid
IntervalInMinutes 60
Debug false

# OData filter examples

Fetch active opportunities created in the last 30 days:

statuscode eq 1 and createdon gt @2024-01-01T00:00:00Z

Fetch cases assigned to a specific user:

ownerid eq '00000000-0000-0000-0000-000000000001'

Fetch high-priority cases:

prioritycode eq 1
Last Updated: 4/15/2026, 8:56:27 AM