VANGELDER SOLUTIONS MCP Guard · Help NederlandsFrançais Product

docs.vangeldersolutions.be/mcp-guard/production-api

Production API

Microsoft Dynamics 365 Business Central has no standard API that writes production orders. The MCP Guard extension adds the write side, so that an AI assistant can work a planning board: read production orders, create, change and delete them, refresh and release them, and reschedule operations. The pages work on Business Central versions 28 and 29.

The endpoint

https://api.businesscentral.dynamics.com/v2.0/{environment}/api/vangelderSolutions/production/v1.0/companies({companyId})/…

EntityObjectOperations
productionOrdersPage 73633181 MCP Guard Prod. Orders APIRead, create, modify, delete. Actions refresh, refreshForward and release.
prodOrderLinesPage 73633182 MCP Guard Prod. Lines APIRead, modify (quantity, dates, location, bin).
prodOrderRoutingLinesPage 73633183 MCP Guard Prod. Routing APIRead, modify (starting and ending date-time, type and number of the work or machine center, times).
capacityLoadsQuery 73633175 MCP Guard Capacity LoadsRead: needed and allocated time per work or machine center, day and production order.

Only a production order can be deleted. Lines and operations cannot be deleted on their own.

What it takes to use them

  1. Assign the permission set MCP GUARD - USER. Since version 1.13.0.0 it holds the production pages, the query and their codeunit, and nothing on business data. The separate set MCP GUARD - PROD no longer exists. See Permission Sets.
  2. Give the user Business Central's own permissions on production orders. Production also requires the Premium experience and licence.
  3. Assign an MCP Guard licence. Without a licence the pages refuse the call, in a sandbox environment too.
  4. Set Production Access on the user's rule. Modify allows changes. Create and Actions also allows creating and deleting orders and the actions. See Access Levels per Module.
  5. Add the pages and the query to the MCP configuration with the operations you want (Read, Create, Modify, Delete, Actions), and turn on Unblock Edit Tools. See MCP Configurations.

Create a production order

Send status, sourceType and sourceNumber first, then quantity and dueDate. The order is stored as soon as its source is known. The fields that follow are validated on the stored order, as on the Production Order page. A production order cannot be created as finished, and it cannot be created without a source number.

Refresh a production order

refresh and refreshForward recreate the lines of the order with their routings and components, like the Refresh Production Order function with every option on. refresh schedules back from the due date. refreshForward schedules forward from the starting date. Business Central refuses the refresh for lines that already have output or consumption. A finished order cannot be refreshed.

The lines of an order are created by the refresh, not through prodOrderLines.

Release a production order

release changes a simulated, planned or firm planned order to released. The status is part of the key of a production order, so the released order is another record. It takes its number from the number series for released orders, which can differ from the number it had. The Location header of the response points at the released order.

A status sent in a change is refused. Use the release action instead.

Delete a production order

Delete the order through productionOrders. Three things must be true:

  • The user's rule grants Create and Actions for Production Access.
  • The MCP configuration has the operation Delete turned on for the page MCP Guard Prod. Orders API, and Unblock Edit Tools turned on.
  • The order can be deleted in Business Central.

The lines, the components and the routing go with the order. Lines and routing lines cannot be deleted on their own.

Business Central decides which orders can be deleted:

  • A finished order stays. The extension refuses to delete it.
  • A released order with output, consumption or capacity posted on it is refused by Business Central. Reverse those postings and finish the order instead.

Reschedule an operation

Change the starting or ending date-time of an operation in prodOrderRoutingLines, or give it another work or machine center with type and number. The change goes through Business Central's own validation, so Business Central moves the operations that follow.

To get the lines or the operations of one order, filter on status and prodOrderNumber.