D365 SCM: Resolving PO Discrepancies with Work IQ & Dataverse

Real business use cases and end-to-end solution designs combining D365 F&O with Power Platform and AI · 10 min read
TL;DR: Connect Dataverse Virtual Entities and Work IQ to Dynamics 365 Supply Chain Management to build autonomous Copilot Studio agents that resolve purchase order variances using governed Business Skills.
D365 F&OSupply ChainDataverseCopilot & AIArchitecture

Standard ERP workflow engines execute deterministic, rule-based branching efficiently, but handling nuanced supplier discrepancies, unit price tolerances, and delivery-date adjustments still consumes substantial procurement effort each month. By combining Microsoft Dataverse and the Work IQ semantic layer with Dynamics 365 Supply Chain Management, solution architects can now build autonomous, context-aware agents that reason across operational data and enforce business rules safely. This guide provides an end-to-end architecture and implementation blueprint for grounding agentic procurement workflows directly in your D365 F&O operational fabric.

At a glance

  • 🔹 Applies to: Dynamics 365 Supply Chain Management (10.0.40+), Microsoft Dataverse, Copilot Studio, Power Platform Admin Center.
  • 🔹 Prerequisites: Power Platform Integration enabled on the F&O environment, Dataverse Virtual Entities generated for procurement tables, Copilot Studio capacity, and Work IQ preview features enabled in the Power Apps Maker portal.
  • 🔹 Effort level: Medium-High (3 to 5 solution architecture and configuration days).
  • 🔹 Outcome: Fully governed Copilot Studio agents that evaluate purchase order quantity/price variances against Dataverse Business Skills and execute authorized D365 SCM updates.

How it works

In traditional integrations, embedding AI into ERP operations requires custom orchestration pipelines, hardcoded validation logic, and fragile endpoint mappings. Work IQ bridges this gap by introducing a shared business semantic layer directly on top of Microsoft Dataverse. Instead of training isolated models or writing hundreds of lines of conditional Logic Apps steps, you model enterprise concepts once. When connected to Dynamics 365 Finance & Operations via Dataverse Virtual Entities (such as mserp_purchtable and mserp_purchline), Work IQ reads operational records natively without duplicating transactional payloads into secondary stores.

Operational reasoning is driven by two new platform components: Dataverse Business Skills and the Dataverse Ask API. Business Skills capture your organizational playbooks—such as multi-tier variance thresholds, freight allowance caps, and vendor performance tiers—as reusable, version-controlled execution contracts. When a purchase discrepancy occurs, a Copilot Studio agent calls the Work IQ Model Context Protocol (MCP) Server. The agent interprets the discrepancy against the Ask API semantic model, evaluates the applicable Business Skill, and executes updates via Agent 365 governance primitives, ensuring all writes execute within the Entra ID security context of the user or a designated service identity.

Work IQ Agentic PO Variance Workflow
Figure 1: End-to-end data and governance flow between Dynamics 365 Supply Chain Management, Dataverse Work IQ, and Copilot Studio.
CapabilityTraditional Power Automate FlowDirect X++ SysOperation ServiceWork IQ & Dataverse Agent
Semantic UnderstandingNone; requires explicit hardcoded schemas and conditional expressions.Strict data dictionary; requires custom X++ classes and contracts.Native; Work IQ understands business entities, acronyms, and relationships.
Business Rule MaintenanceNested switch statements or external Azure Rule Engines.X++ code modifications, testing, and service package deployments.Low-code Business Skills managed and versioned in Power Apps Maker portal.
Exception HandlingRigid failure branching; escalates all non-matching variations to humans.Infolog errors; aborts transaction batch rollbacks.Autonomous evaluation; resolves within confidence limits or drafts summaries.
Execution GovernanceConnection References (shared Service Principal or user account).F&O Security Roles, table permissions, and AOS execution context.Agent 365 framework enforcing granular runtime and data policy controls.
📝 NoteDataverse Virtual Entities for D365 F&O query the Application Object Server (AOS) directly via real-time OData calls. Ensure your F&O environment sizing accounts for agent query frequency to prevent throttling on high-volume tables.

Step-by-step solution

1. Expose D365 SCM Purchasing Entities in Dataverse

  1. In the Power Apps Maker portal, navigate to the Available Dynamics 365 for Operations Entities catalog table.
  2. Locate the Purchase order headers V2 (mserp_purchtable) and Purchase order lines V2 (mserp_purchline) entities in the entity catalog list.
  3. Select each entity, click Visible, and select Generate. Verify in the Power Apps Maker portal under Tables that the virtual entities display active schema metadata.

2. Construct the Purchasing Semantic Model in Work IQ

  1. Open the Power Apps Maker portal (make.powerapps.com) in the environment bound to your D365 F&O instance, and navigate to your working Solution.
  2. Create a new Semantic Model linking mserp_purchtable and mserp_purchline through their primary relationship (PurchId).
  3. Assign explicit synonyms, business descriptions, and measurement metrics (e.g., map "Line Amount" to mserp_lineamount and define "Receipt Overdue" as a calculated property comparing mserp_confirmeddeliverydate to the current date).

3. Implement the Tolerance Business Skill in Power Apps Maker Portal

  1. Within your Maker portal solution, navigate to Business Skills (preview) and select New Business Skill.
  2. Configure the skill definition EvaluatePurchaseOrderVariance with input parameters for PurchId, InvoicePrice, and InvoicedQuantity.
  3. Define the operational rule playbook using natural language and structured constraints: specify that price increases below 5% within approved tolerance limits are approved automatically if vendor rating exceeds 90, while higher variances trigger an approval routing ticket.
💡 Pro tipUse the built-in version history feature in Business Skills. As procurement policies change between fiscal quarters, you can roll back or test modified skills without rebuilding your Copilot agents.

4. Configure the Dataverse Ask API Endpoint

  1. In your Dataverse environment, enable the Ask API feature preview under Power Platform Admin Center > Environments > Settings > Features.
  2. Construct a custom API or test the endpoint directly via the Dataverse Web API via the Dataverse Web API or Dataverse Connector to validate that natural-language queries against purchase lines return structured JSON matching tables and fields.
POST [Organization URI]/api/data/v9.2/AskApi
Content-Type: application/json
Accept: application/json

{
  "semanticModelName": "PurchasingProcurementModel",
  "query": "Retrieve all open lines for PurchId PO-2026-8812 with price variance exceeding 3%",
  "mode": "Accurate"
}

5. Build the Agent in Copilot Studio with Work IQ MCP

  1. Launch Microsoft Copilot Studio and create an agent named Procurement Variance Agent.
  2. Under Tools, add the Work IQ MCP Server connector, pointing to your Dataverse environment to inherit your semantic model and the EvaluatePurchaseOrderVariance Business Skill.
  3. Configure the trigger topic to listen for D365 SCM business events (e.g., VendInvoiceHeaderReceived or PurchaseOrderHoldCreated) pushed via Dataverse business event catalogs.

6. Apply Governance and Security via Agent 365

  1. In Copilot Studio, configure the authentication mode to Authenticate with Microsoft (Entra ID).
  2. In the Power Platform Admin Center, assign the agent execution role to use delegated security contexts or a constrained Application User with the Purchasing Agent (Virtual) security role.
  3. Set up data loss prevention (DLP) policies to block unapproved connectors and restrict the agent's write capabilities exclusively to specific Dataverse custom actions.
⚠️ Watch outNever configure autonomous agents with System Administrator privileges in Dataverse or Dynamics 365. Always restrict the execution identity to targeted roles that prevent unauthorized postings directly to general ledger accounts.

Worked example

Apex Industrial Supplies manufactures heavy fluid-handling systems using D365 SCM 10.0.42. The purchasing department processes thousands of purchase order lines weekly across its industrial component suppliers. Purchase order PO-2026-8812 was issued to vendor US-104 (Contoso Flow Systems) for 500 hydraulic flow valves . Upon delivery, the electronic vendor invoice (INV-90211) arrived with a unit price variance of 3.75%, which placed the pending vendor invoice on automated payment hold.

Instead of escalating the hold to an Accounts Payable clerk, the Copilot Studio agent triggered on the invoice variance event. Using the Work IQ MCP server, the agent queried the PurchasingProcurementModel via the Dataverse Ask API to review the historical vendor records. The agent found that vendor US-104 maintains a 97% on-time delivery metric and an agreement clause permitting steel-index surcharges up to 4.0%. The agent evaluated the EvaluatePurchaseOrderVariance Business Skill, verified that the 3.75% increase fell below the company's 5% threshold, updated the matching tolerance override flag on mserp_purchline, and documented the audit log directly on the record.

PATCH [Organization URI]/api/data/v9.2/mserp_purchlines(mserp_purchlineid='c9d2f831-291b-ef11-9f8a-000d3a2c5a11')
Content-Type: application/json

{
  "ToleranceReasonCode": "WORKIQ_AUTO_APPROVED",
  "VariancePercentage": 3.75,
  "ApprovalJustification": "Variance of 3.75% within 5% threshold; steel surcharge validated against Master Agreement MA-2025.",
  "ExecutionMode": "Automated"
}

Total cycle time to clear the discrepancy was significantly reduced, preventing supply chain delivery holds with complete auditability.

-96%
resolution cycle reduction
84%
variance auto-resolution
0
compliance audit errors
PO Discrepancy Resolution Cycle Time (Hours)
Figure 3: Average operational hours required to process and clear vendor invoice discrepancies at Apex Industrial Supplies.

Automation and AI opportunities

Integrating Work IQ with Dataverse unlocks several advanced automation patterns across the enterprise:

  • Proactive Teams Escalations: When a variance exceeds automated approval thresholds (e.g., an 8% increase), the agent can compose an adaptive card in Microsoft Teams directed to the specific buyer assigned in mserp_purchtable.BuyerGroup, providing a 1-click approval button with full context.
  • Analytical Cross-Grounding with Fabric IQ: By combining Work IQ with Fabric IQ, agents can read analytical measures (such as vendor fill-rate trends calculated in Power BI semantic models) alongside operational Dataverse tables before executing vendor hold actions.
  • Automated PO Line Balancing: Combine the Dataverse Ask API with Power Automate flows to reconcile receipt line discrepancies where multiple shipments are combined across split delivery schedules.

Common pitfalls and troubleshooting

  1. Virtual Entity Query Timeouts on Large Tables:
    Symptom: The Dataverse Ask API throws HTTP 504 Gateway Timeout when executing queries over purchase order lines.
    Cause: The query executes unfiltered OData reads against D365 F&O without indexing on the filtered columns.
    Fix: In the Work IQ semantic model, specify mandatory filter parameters (such as DataAreaId and PurchStatus) to ensure generated queries leverage native clustered indexes in SQL Server.
  2. Hallucinated Business Skill Application:
    Symptom: The agent approves invoices that exceed authorized price variation thresholds.
    Cause: The Business Skill instructions are ambiguous or lack explicit boundary clauses.
    Fix: In the Power Apps Maker portal, redefine the Business Skill using formal condition blocks with deterministic validation rules rather than broad conversational guidelines.
  3. Delegated Authentication Failures in Agent 365:
    Symptom: Custom API execution fails with an HTTP 403 Forbidden error during write-backs to D365 F&O.
    Cause: The Microsoft Entra ID enterprise application lacks the user_impersonation scope or the service user is missing security mappings in F&O System Administration.
    Fix: Ensure the App Registration has appropriate API permissions for Dynamics ERP and verify the User ID mapping in System administration > Users > Users.
  4. Schema Desynchronization:
    Symptom: Dataverse Ask API reports missing properties after an F&O deployment.
    Cause: Metadata was altered in X++ table extensions without refreshing the Dataverse Virtual Entity schema.
    Fix: In the Power Apps Maker portal, locate the entity in the Available Dynamics 365 for Operations Entities catalog, trigger a schema refresh, and verify the updated table definition in Dataverse.
  5. Stale Semantic Cache:
    Symptom: The Copilot Studio agent ignores updated Business Skill rules.
    Cause: The Work IQ MCP Server caches model context to optimize query throughput.
    Fix: In Copilot Studio, publish a new revision of the agent and force a reconnect to the Dataverse MCP server endpoint.

Best-practice checklist

  • ✅ Always map primary operational keys (PurchId, DataAreaId) explicitly in the Work IQ semantic model.
  • ✅ Structure Business Skills with discrete numeric thresholds rather than conversational approximations.
  • ✅ Restrict agent execution accounts using least-privilege Dataverse security roles and explicit F&O security duties.
  • ✅ Implement telemetry tracking and audit logging on all records modified by automated agent actions.
  • ✅ Ensure Dataverse Virtual Entities utilize filtered OData queries to prevent table locks in the F&O database.
  • ✅ Validate all custom write-back APIs against sandbox workloads before routing live vendor invoices through agents.
  • ✅ Review Business Skill version history periodically to align autonomous decisions with changing corporate procurement policies.

FAQ

Does Work IQ replicate my D365 F&O operational data into Dataverse storage?

No. When leveraging Dataverse Virtual Entities, operational records remain inside the D365 Finance & Operations database. Work IQ reads the metadata and executes real-time OData calls to retrieve and evaluate context without duplicating large transactional tables into Dataverse storage.

Can Business Skills be governed under source control for enterprise ALM?

Yes. Business Skills created in the Power Apps Maker portal are solution-aware components. They can be exported inside managed solutions, committed to Git repositories via Azure DevOps or GitHub, and deployed across environments using standard Power Platform ALM pipelines.

What licensing is required to run Work IQ agents connected to D365 SCM?

Users interacting with the agent or triggering agent executions require qualifying Dynamics 365 Supply Chain Management licenses, Copilot Studio capacity credits, and a Dataverse environment with preview features enabled. Refer to the official Microsoft Power Platform and Dynamics 365 licensing guides for exact tenant entitlements.

Key takeaways

Work IQ Architecture for D365 F&O
Figure 2: Core structural pillars of Work IQ and Dataverse integration with D365 Finance & Operations.
  • Model Once, Reason Everywhere: Work IQ unifies ERP records, acronyms, and processes into a shared semantic model that grounds AI agents in real business context.
  • Playbooks as Business Skills: Shift from hardcoded logic and brittle workflows to maintainable, version-controlled Business Skills managed directly in the Maker portal.
  • Secure, Governed Actions: Agent 365 ensures autonomous agents execute updates through strictly bounded Entra ID credentials and Dataverse roles, safeguarding core financial and supply chain records.

Further reading

Note: written with AI assistance and reviewed by Gaurav Jadaun. Always validate in a sandbox environment before applying to production.

Comments

Popular posts from this blog

Monthly Inventory Close in Microsoft Dynamics AX 2012

Product Configuration Technology Ax2012R3

How to configure Fixed Assets Module in Ax2012