.png)

Dynamics 365 Sales Integration Guide
Integrate Dynamics 365 Sales with enterprise systems through the Dataverse OData REST Web API, selected webhooks, change tracking, batch operations, and Microsoft Entra ID.
Dynamics 365 Sales integration options at a glance
Dynamics 365 Sales exposes its business data through the Microsoft Dataverse Web API, a RESTful OData 4.0 interface supporting CRUD operations, queries, relationships, actions, functions, metadata, pagination, ETags, and batch processing. Dataverse also supports selected webhook notifications, change tracking for incremental synchronization, and file and attachment operations. Microsoft Entra ID OAuth 2.0 provides delegated and server-to-server authentication, while the legacy Organization Service remains available for some SOAP-based scenarios. Martini can consume these endpoints, receive selected webhook notifications through an exposed API, schedule incremental workflows, map Dataverse tables, apply business rules, and coordinate downstream writes.
| Integration point | Supported by Dynamics 365 Sales? | Common use cases | How Martini supports it |
|---|---|---|---|
| Dataverse REST Web API | Yes | Create, read, update, and delete Accounts, Contacts, Leads, Opportunities, Quotes, Orders, Invoices, Activities, and custom Dataverse tables. OData queries support filtering, selection, expansion, ordering, pagination, relationships, actions, functions, and metadata. | Martini can consume the Web API from workflows, configure authenticated requests, transform responses, apply business rules, and expose APIs for downstream systems. |
| Webhooks / outbound callbacks | Limited | Notify an external endpoint when selected Dataverse messages and tables produce registered events, such as changes to Leads, Opportunities, Accounts, or Contacts. | Martini can expose an API to receive selected Dataverse webhook notifications, validate the notification, retrieve the current resource, and start a workflow. Coverage must be confirmed for each table and message. |
| Change tracking | Yes | Retrieve changes to enabled Dataverse tables since a previous synchronization point for incremental Account, Contact, Lead, Opportunity, and other table synchronization. | Martini can schedule workflows, persist continuation state, retrieve changed rows, process successful results, and advance the token only after the target write completes. |
| Bulk, batch, and asynchronous operations | Yes | Use OData $batch, changesets, CreateMultiple, UpdateMultiple, UpsertMultiple, and selected asynchronous operations for higher-volume processing. Support varies by table and operation. | Martini can group requests where appropriate, map batch results, control concurrency, and implement retry and reconciliation logic for partial or failed operations. |
| File and attachment APIs | Limited | Transfer File column content, Image column content, Annotation notes and attachments, and email attachment records. Each storage model has a different Dataverse representation. | Martini can retrieve or upload content through the relevant Web API operations while preserving file name, media type, size, encoding, and related object identifiers. |
| SOAP Organization Service | Legacy | Support existing Dynamics or Dataverse integrations that still require the Organization Service or an operation unavailable through the preferred Web API. | Martini can consume SOAP services for legacy scenarios, while new implementations should generally use the Dataverse REST Web API. |
| TDS analytics endpoint | Limited | Run read-only SQL-compatible queries for reporting and analytics where the Dataverse environment enables the Tabular Data Stream endpoint. | Martini can use database-oriented integration capabilities for analytical extraction where appropriate, but transactional Dataverse reads and writes should use the Web API. |
| Microsoft Entra ID OAuth 2.0 | Yes | Authenticate delegated user flows or server-to-server client-credentials integrations using application registrations, application users, permissions, and Dataverse security roles. | Martini can configure secured API consumption with environment-specific credentials and secrets. Access remains subject to Dataverse roles, business units, ownership, and field security. |
How Dynamics 365 Sales exposes data and business events
Dynamics 365 Sales REST APIs
Dynamics 365 Sales exposes Dataverse tables and operations through an OData 4.0 REST Web API. It supports CRUD operations, filtered queries, relationships, actions, functions, metadata, conditional requests, pagination, and batch operations.
Martini implementation pattern
Martini implementation pattern: a workflow authenticates with Microsoft Entra ID, calls the Dataverse Web API, follows continuation links, maps the response to a canonical model, applies business rules, and writes to one or more target systems. Martini can also expose a controlled API façade for downstream consumers.
Implementation sequence
Dynamics 365 Sales webhooks
Dataverse supports webhook notifications for selected registered messages and tables. Webhooks are not a universal event stream, so coverage depends on the table, message, execution stage, and filtering configuration.
Martini implementation pattern
Martini implementation pattern: an exposed Martini API receives the notification, validates the request, derives an idempotency key, and invokes a workflow that retrieves the current Lead, Opportunity, Account, Contact, or other resource through the Web API. The notification is treated as a trigger rather than a complete authoritative payload.
Implementation sequence
Dynamics 365 Sales change tracking
Dataverse change tracking provides continuation state for retrieving changes made to enabled tables since a previous synchronization point. It is suited to incremental synchronization of sales data without repeatedly reading every row.
Martini implementation pattern
Martini implementation pattern: a scheduled workflow loads the last successful continuation state, calls the relevant Dataverse change-tracking operation, processes pages of changed rows, and persists the new state only after downstream writes succeed or a replay strategy is established.
Implementation sequence
Dynamics 365 Sales batch and bulk operations
The Dataverse Web API supports $batch requests, changesets, and bulk messages such as CreateMultiple, UpdateMultiple, and UpsertMultiple where supported. Table and operation support must be confirmed before implementation.
Martini implementation pattern
Martini implementation pattern: a workflow groups compatible writes, constructs the appropriate Dataverse request, controls concurrency to respect service protection limits, evaluates individual results, and retries or reconciles failed items without assuming every batch is wholly successful.
Implementation sequence
Dynamics 365 Sales file and attachment APIs
Dataverse supports File columns, Image columns, Annotation notes and attachments, and email attachment records. These models use different tables and operations and should not be treated as interchangeable.
Martini implementation pattern
Martini implementation pattern: a workflow identifies the storage model, retrieves metadata and content through the relevant Web API operation, transfers the file to the target application, and preserves the relationship, file name, media type, size, and encoding.
Implementation sequence
Common Dynamics 365 Sales integration patterns
Pattern 1: Synchronize Accounts and Contacts
When to use this pattern
Use this pattern when customer master data must be shared with an ERP, service application, reporting platform, or another CRM. Change tracking avoids repeated full-table reads, while stable identifiers and upserts make retries safe.
Integration direction
Example Mapping
| Dynamics 365 Sales Field | Canonical Field | Target Field |
|---|---|---|
| account.accountid | customer.externalId | customer.sourceId |
| account.name | customer.name | customer.name |
| contact.emailaddress1 | contact.email | contact.emailAddress |
| contact.parentcustomerid | contact.accountExternalId | contact.customerId |
Martini implementation pattern
A scheduled Martini workflow loads the previous change-tracking state, retrieves changed Accounts and Contacts, follows pagination, maps lookups and customized fields, validates required data, and upserts the target records. It stores the continuation state only after successful target writes and routes throttling or validation failures for retry or review.
Martini capabilities used
- scheduled workflows
- API consumption
- change-tracking orchestration
- data mapping
- business rules
- idempotent upserts
- error handling
Pattern 2: Route Lead and Opportunity events
When to use this pattern
Use this pattern when selected sales changes should trigger near-real-time processing without treating Dataverse webhooks as a complete event payload. It is suitable for qualification, enrichment, notifications, or downstream CRM synchronization.
Integration direction
Example Mapping
| Dynamics 365 Sales Field | Canonical Field | Target Field |
|---|---|---|
| lead.leadid | prospect.externalId | Lead.externalId |
| lead.subject | prospect.name | Lead.name |
| lead.statuscode | prospect.status | Lead.status |
| opportunity.estimatedvalue | deal.amount | Opportunity.amount |
Martini implementation pattern
Martini exposes an API for selected Dataverse webhook notifications, validates and deduplicates each notification, retrieves the current Lead or Opportunity and related records through the Web API, then applies qualification and routing rules before an idempotent target upsert. Failed deliveries are logged and retried without duplicating the business object.
Martini capabilities used
- API exposure
- webhook consumption
- workflow orchestration
- data retrieval
- validation
- business rules
- duplicate detection
- retry handling
Pattern 3: Process won Opportunities into Orders
When to use this pattern
Use this pattern when a won Opportunity or newly created Order must initiate finance, fulfillment, or ERP processing. The workflow can enrich the order with customer, product, Quote, and pricing information before sending it downstream.
Integration direction
Example Mapping
| Dynamics 365 Sales Field | Canonical Field | Target Field |
|---|---|---|
| opportunity.opportunityid | order.salesReference | salesOrder.crmOpportunityId |
| salesorder.name | order.orderNumber | salesOrder.externalReference |
| salesorder.customerid | order.customerExternalId | salesOrder.customer |
| salesorder.totalamount | order.totalAmount | salesOrder.total |
Martini implementation pattern
A webhook-triggered or scheduled Martini workflow retrieves the current Order and related objects, verifies that the status is eligible for export, validates customer and line data, transforms currency and lookup values, and submits the order to NetSuite. The workflow records the target identifier in Dataverse and retries transient failures while isolating business validation errors.
Martini capabilities used
- event-driven workflows
- REST API consumption
- relationship expansion
- data transformation
- conditional routing
- error handling
- reconciliation
Pattern 4: Export sales activities and attachments
When to use this pattern
Use this pattern when Activities, Notes, File columns, or email attachments need to be transferred to a document, support, or records platform. The storage model must be identified before choosing the retrieval operation.
Integration direction
Example Mapping
| Dynamics 365 Sales Field | Canonical Field | Target Field |
|---|---|---|
| activity.activityid | interaction.externalId | interaction.sourceId |
| activity.subject | interaction.subject | interaction.title |
| annotation.filename | document.fileName | attachment.name |
| annotation.mimetype | document.mediaType | attachment.contentType |
Martini implementation pattern
Martini retrieves selected Activities and related Annotation or file content through a scheduled or event-driven workflow, preserves associations and metadata, streams or bounds large content where appropriate, and creates the corresponding target interaction or attachment. Stable Dataverse identifiers prevent duplicate exports during retries.
Martini capabilities used
- scheduled workflows
- API consumption
- file handling
- data mapping
- content metadata preservation
- idempotency
- monitoring
Applications commonly integrated with Dynamics 365 Sales
Dynamics 365 Sales data commonly participates in broader Microsoft, ERP, service, finance, document, and analytics processes. Martini can coordinate these integrations through Dataverse APIs, selected notifications, scheduled synchronization, transformations, and reusable workflows. The exact direction and scope depend on the deployed applications, Dataverse customizations, and business ownership model.
| Application | Scenario | Direction | Martini Pattern |
|---|---|---|---|
| Microsoft Dynamics 365 Finance | Synchronize customers, products, orders, invoices, and financial status between sales and finance processes. | Dynamics 365 Sales → Martini → Microsoft Dynamics 365 Finance | Martini consumes Dataverse Accounts, Contacts, Orders, and Invoices, maps them to the finance application model, applies ownership and status rules, and writes returned identifiers or statuses back through the Dataverse Web API. |
| Microsoft Dynamics 365 Supply Chain Management | Transfer confirmed orders and product or fulfillment information into operational processes and return fulfillment status. | Dynamics 365 Sales → Martini → Microsoft Dynamics 365 Supply Chain Management | A webhook or scheduled workflow retrieves the current Order and related customer and product data, validates fulfillment criteria, sends an operational payload, and updates Dataverse with the external reference or status. |
| Salesforce | Support CRM coexistence, migration, or consolidation involving Accounts, Contacts, Leads, and Opportunities. | Dynamics 365 Sales → Martini → Salesforce | Martini reads changed Dataverse tables, maps logical names, lookups, choices, and identifiers to Salesforce fields, applies conflict rules, and uses stable external keys for idempotent upserts in either direction. |
| ServiceNow | Share customer context and sales-related requests with service and operational workflows. | Dynamics 365 Sales → Martini → ServiceNow | Martini receives selected Dataverse notifications or runs a scheduled query, enriches Accounts and Contacts with related sales information, maps the result to ServiceNow records, and records cross-system identifiers for updates. |
| SAP S/4HANA | Exchange customer, product, quotation, order, and invoice information between sales and ERP processes. | Dynamics 365 Sales → Martini → SAP S/4HANA | A Martini workflow retrieves Dataverse business objects, normalizes dates, currencies, lookups, and status values, invokes the SAP integration endpoint, and handles retries and reconciliation for failed documents. |
| NetSuite | Send customers, products, and Orders for finance, billing, and fulfillment while returning order or invoice status. | Dynamics 365 Sales → Martini → NetSuite | Martini orchestrates Order and customer retrieval, transforms Dataverse fields into NetSuite payloads, applies duplicate detection using external identifiers, and writes returned references or statuses back to Dataverse. |
| Adobe Sign | Send Quotes or sales documents for electronic signature and return signature status to the sales process. | Dynamics 365 Sales → Martini → Adobe Sign | Martini retrieves the Quote and associated file or attachment content, submits a signature request, stores the external envelope identifier, and processes status callbacks or scheduled status checks. |
| Power BI | Analyze Accounts, Leads, Opportunities, Activities, pipeline stages, and sales performance. | Dynamics 365 Sales → Martini → Power BI | Martini performs filtered or incremental Dataverse extraction, maps customized tables and choice values into an analytics model, and delivers prepared data through the selected reporting architecture. |
How to build a Dynamics 365 Sales integration in Martini
Objective
Establish access to the Dataverse environment using Microsoft Entra ID and an appropriately restricted application user or delegated identity.
Instructions in Martini
- Configure the Dataverse environment URL and API version as environment-specific settings
- Use OAuth 2.0 client credentials for server-to-server processing or delegated authorization when user context is required
- Store client secrets and related credentials in secure Martini configuration
- Confirm Dataverse security roles, business unit access, ownership, and field permissions
Objective
Select the trigger that matches the synchronization requirement rather than assuming every Dataverse change is available as an event.
Instructions in Martini
- Use a Dataverse webhook for selected registered messages and tables
- Use a scheduler for change tracking, reconciliation, or periodic extraction
- Use an API trigger when an external application initiates the process
- Define the expected delivery, replay, and idempotency behavior
Objective
Retrieve the current authoritative Dataverse resource and related data using focused Web API queries.
Instructions in Martini
- Use $select and $filter to limit unnecessary reads
- Follow continuation links for paginated results
- Expand relationships only where required
- Retrieve the full row after a webhook notification because the notification may not contain the complete business payload
Objective
Coordinate validation, enrichment, routing, target writes, and source updates in a maintainable Martini workflow.
Instructions in Martini
- Separate retrieval, transformation, business rules, and target delivery into clear workflow stages
- Use conditional routing for status, ownership, qualification, and target-system rules
- Group compatible writes into batch or bulk operations only where supported
- Persist checkpoints and external identifiers at appropriate stages
Objective
Convert Dataverse logical names, lookups, choices, dates, currencies, files, and customized columns into the target model.
Instructions in Martini
- Map Dataverse tables to a canonical model before target-specific transformation
- Handle GUIDs, navigation properties, option-set values, and owner references explicitly
- Preserve file metadata and relationships when transferring attachments
- Validate required fields and reject or route incomplete payloads
Objective
Deliver transformed data to the target system and maintain cross-system identifiers for safe reprocessing.
Instructions in Martini
- Use idempotent create-or-update behavior where supported
- Write target identifiers or processing status back through the Dataverse Web API when required
- Handle partial batch results at item level
- Keep failed items available for replay and reconciliation
Common Dynamics 365 Sales data objects used in integrations
| Object | Typical Use | Common target systems | Martini handling |
|---|---|---|---|
| Accounts | Represent organizations or customer companies involved in sales relationships. | Dynamics 365 Finance, SAP S/4HANA, NetSuite, Salesforce, ServiceNow, Power BI | Martini retrieves Accounts through the Web API or change tracking, expands related data when needed, maps logical names and customized columns, and uses the Dataverse row GUID or an external identifier for idempotent synchronization. |
| Contacts | Represent people associated with Accounts, Opportunities, and other sales processes. | Salesforce, ServiceNow, Dynamics 365 Finance, Power BI | Martini maps contact details, account lookups, ownership, choice values, and custom fields, applying validation and duplicate rules before creating or updating the target object. |
| Leads | Represent prospective customers before qualification. | Salesforce, marketing applications, ServiceNow, Power BI | Martini can process selected webhook notifications or incremental changes, retrieve the complete Lead and related data, validate qualification fields, and route the result according to business rules. |
| Opportunities | Represent qualified potential sales, pipeline stages, values, and expected close information. | Power BI, Salesforce, Dynamics 365 Finance, SAP S/4HANA | Martini retrieves current Opportunity data after a notification, maps stage and amount values, enriches related Account and Contact information, and applies idempotent upsert and retry behavior. |
| Quotes | Represent formal sales quotations associated with customers or Opportunities. | Adobe Sign, Dynamics 365 Finance, SAP S/4HANA, NetSuite | Martini maps quotation lines, customers, totals, currencies, and statuses, and can coordinate document or signature flows when related files or attachments are present. |
| Orders | Represent confirmed customer orders created from Quotes or Opportunities. | Dynamics 365 Supply Chain Management, Dynamics 365 Finance, SAP S/4HANA, NetSuite | Martini retrieves Orders with related customer and product information, validates status and identifiers, sends normalized order payloads, and writes external references or fulfillment status back to Dataverse. |
Authentication and security considerations
Microsoft Entra ID authentication
Dynamics 365 Sales uses Microsoft Entra ID OAuth 2.0 rather than API keys or basic authentication. Martini can use delegated authorization when user context is required or client credentials for server-to-server workflows with a Dataverse application user.
Dataverse authorization
A valid access token does not by itself grant access to every table or column. Dataverse security roles, application users, business units, ownership, field security profiles, and access teams determine the data and operations available to an integration.
Secure configuration
- Store client credentials, environment URLs, scopes, and API versions as protected environment configuration.
- Use least-privilege Dataverse roles for application users.
- Protect exposed Martini APIs and validate incoming webhook requests.
- Separate development, test, and production credentials and endpoints.
Operational considerations for Dynamics 365 Sales integrations
Service protection and pagination
Dataverse applies service protection limits based on request volume, execution time, and concurrency. Use targeted queries, change tracking, continuation links, controlled concurrency, and exponential backoff for throttling responses.
Idempotency and checkpoints
Webhook deliveries and retries can repeat the same business event. Use Dataverse row GUIDs, external identifiers, or event keys for duplicate detection, and advance change-tracking state only after the corresponding target writes succeed.
Schema and concurrency
Dataverse environments can contain customized tables, columns, choices, lookups, and required fields. Use logical names and configurable mappings, and consider ETags when overwriting a newer source change would be harmful.
Files and testing
File columns, Image columns, Annotation records, and email attachments require different operations. Test each model, large-file behavior, API version changes, permissions, partial batch results, and replay scenarios in a non-production environment.
Why use Martini instead of scripts or point-to-point integrations?
Orchestrate more than an API call
Martini coordinates authentication, Dataverse retrieval, webhook handling, change tracking, pagination, transformations, business rules, downstream writes, and source-system updates in reusable workflows.
Reduce point-to-point complexity
Instead of maintaining separate scripts for every target, Martini can establish canonical mappings, shared error handling, durable checkpoints, and consistent retry and reconciliation behavior across integrations.
Support evolving Dataverse environments
Environment configuration, logical-name mappings, validation, and workflow-based routing help integrations accommodate customized tables, fields, choices, relationships, and deployment-specific security without embedding every assumption in one script.
- Consume REST and legacy SOAP services where appropriate.
- Expose controlled APIs for webhook intake or downstream consumers.
- Apply reusable transformations and business rules.
- Monitor workflow execution and troubleshoot failed or replayed items.
Frequently asked questions
Dynamics 365 Sales can be integrated through the Microsoft Dataverse OData 4.0 Web API, selected Dataverse webhooks, change tracking, batch and bulk operations, file and attachment APIs, and the legacy SOAP Organization Service where required. Microsoft Entra ID OAuth 2.0 secures access, while scheduled or event-driven workflows can synchronize Accounts, Contacts, Leads, Opportunities, Quotes, Orders, Invoices, and Activities.
Yes. Martini can consume the Dynamics 365 Sales Dataverse REST Web API, authenticate with Microsoft Entra ID OAuth 2.0, receive selected Dataverse webhook notifications through an exposed API, run scheduled change-tracking synchronizations, and map and orchestrate data into downstream systems. No native Martini connector is documented in the supplied research.
No dedicated Dynamics 365 Sales connector is required. Martini can use the confirmed native integration mechanisms: the Dataverse Web API, selected webhooks, change tracking, batch or bulk requests, file operations, OAuth 2.0 authentication, and SOAP only for legacy requirements.
Lonti does not charge an additional per-connector or per-vendor fee to integrate Dynamics 365 Sales with Martini. Integration use is subject to the provisioned capacity of the Martini environment. Separate costs may apply from Microsoft, Dataverse, Azure or other infrastructure, and third-party systems depending on licensing, usage, and deployment.
The Dataverse Web API is the preferred interface for new integrations because it supports CRUD operations, OData queries, relationships, actions, functions, metadata, conditional requests, pagination, and batch processing. The Organization Service SOAP interface is primarily relevant to legacy deployments or operations not available through REST.
No. Dataverse webhooks are registered for selected tables and messages and depend on execution and filtering configuration. They should be treated as notifications that trigger a follow-up Web API retrieval, not as a universal event stream or necessarily complete business payload.
Martini can use Dataverse change tracking in scheduled workflows to retrieve rows changed since a stored continuation point. It can also combine selected webhook notifications with authoritative Web API retrieval. The workflow should persist synchronization state only after successful processing or maintain a replay strategy, and should use stable identifiers for idempotent upserts.
Martini maps Dataverse logical names, GUIDs, lookups, choice values, customized columns, files, and relationships into canonical and target models. Workflows can validate data, apply business rules, retry transient failures with throttling-aware backoff, isolate validation errors, and use row GUIDs, external identifiers, or event keys to prevent duplicate processing.
Related Martini documentation
APIs
Plan your Dynamics 365 Sales integration
Use Martini to connect Dataverse data and events with enterprise applications through secure APIs, scheduled workflows, transformations, and reliable operational controls.