Business Central and DeepSeek Harness (Part 4)

Neil Haddley โ€ข November 18, 2026

Give the AI the company's own way of working: a short SOP, a work instruction and a hand-over note, in plain files it reads before each task. One house rule, a default lead time the person confirms, shows the idea.

AIBusiness Centralbusiness-centralsopwork-instructiondeepseekwiki

In Part 2 I typed "Sell 2 BERLIN Guest Chair, yellow to Adatum Corporation at list price", and the AI made a draft. It did a decent job, with nothing written down. But a company has its own way of doing things, and "decent" is not the same as "ours". This post puts that way of working in plain files that the AI reads before it starts.

What lives in the folder

The harness works inside a folder. Mine looks like this:

CODE
1CLAUDE.md                                   the front page: where things are, three rules
2wiki/entities/business-central-connection.md   which company, which tools, how to write a link
3wiki/procedures/
4    procedures-index.md                     the list of procedures
5    sop-create-sales-order.md               the SOP: what, why, who decides
6    wi-look-up-customer-item.md             work instruction: how to look things up
7    wi-create-sales-order-with-line.md      work instruction: the exact tool calls
8    wi-verify-draft-order.md                work instruction: how to check the draft
9    handover.md                             how every task ends
  • A SOP (standard operating procedure) says what we do, why, and who decides.
  • A work instruction says how, step by step, down to the button or the tool call.

These are old business ideas. Here, the reader happens to be an AI.

The front page

The harness loads CLAUDE.md into every session. Mine is short, and exactly this:

MARKDOWN
1# Business Central assistant: workspace notes
2
3You help a small company work in Business Central through the MCP tools in your tool list. You can read customers, vendors and items, and create or change DRAFT sales orders. You cannot post or delete anything yourself.
4
5## Where things are
6- `wiki/entities/business-central-connection.md`: which company and environment you are connected to, what your tools can and cannot do, and how to write a link to a document. Read it before you write a link.
7- `wiki/procedures/`: the company's procedures. Before a Business Central task, read `procedures-index.md`, then the SOP for the task and the work instructions it links to, and follow them.
8- End every task with the hand-over in `wiki/procedures/handover.md`.
9
10## Rules
11- Look things up before asking. Ask only for what you cannot look up, and ask everything in one round.
12- Never guess a price or a quantity.
13- Do not edit files in this wiki unless the person asks you to.

The SOP

This is the SOP, exactly as the AI reads it:

MARKDOWN
1---
2title: SOP - Create a draft sales order
3type: sop
4updated: 2026-11-18
5---
6# SOP: Create a draft sales order
7
8**Purpose:** turn "sell N of item X to customer C" into a correct, unposted draft sales order.
9
10**Decision rights:** you prepare the draft. A person decides whether it is posted. You never edit an existing order to fit a new request.
11
12## Facts you need before creating anything
13| Fact | Where to get it | If missing |
14|---|---|---|
15| Customer | look it up ([[wi-look-up-customer-item]]) | ask |
16| Item | look it up | ask |
17| Quantity | the request | ask |
18| Unit price | the request. "List price" means the item's `unitPrice` | ask |
19| Delivery date | the request | follow the house rule below |
20| Stock | `inventory` on the item | warn if the quantity is more than the stock |
21
22## House rules
23These are this company's own choices. Business Central does not enforce them.
24
25| Rule | Value |
26|---|---|
27| Default lead time | 5 calendar days after the order date |
28
29**Delivery date rule.** If the request names no delivery date, work out the order date plus the default lead time. A new order's order date is today's date: get it from the computer's clock (for example with `date`), never from an earlier draft. Ask the person to confirm that date, or give another one. Put this question in the same single round as any other missing fact, with the default date as the recommended answer. Never apply the default without asking. Then set `requestedDeliveryDate` on the order and say in the hand-over which date you used and where it came from.
30
31## Steps
321. Look up the customer and item.
332. Check the customer's existing draft orders for the same item, and check stock.
343. Ask for what is missing, once.
354. Create the order and its line ([[wi-create-sales-order-with-line]]).
365. Read it back and check the numbers ([[wi-verify-draft-order]]).
376. End with the hand-over ([[handover]]).
38
39## Guardrails
40Create drafts only. Never guess a price. Do the arithmetic in code, not in your head.

Read the House rules table. A company makes choices that Business Central does not enforce. This one is mine, and I made the number up: default lead time, 5 calendar days after the order date. Another company would choose differently. The rule has two parts. First the default, and then a person confirms it. The AI is not allowed to apply it silently.

Scroll sideways, or tap the diagram to open it full size

The work instruction

The SOP says "create the order". The work instruction says exactly how, in tool names:

MARKDOWN
1---
2title: WI - Create a sales order with one line
3type: work-instruction
4updated: 2026-11-18
5---
6# WI: Create a sales order with one line
7
8**Tools:** `Create_SalesOrder_PAG30028`, then the **child** tool whose name starts `Create_SalesOrderLinesOfSales_` (use the exact name in your tool list). Use the child tool for the line.
9
10## 1. Header
11`Create_SalesOrder_PAG30028` with `customerId` (the GUID) and `customerNumber`. Add `requestedDeliveryDate` (`YYYY-MM-DD`) when the SOP's delivery date rule gives you one. Ask for `select`: `id,number,status,customerName,orderDate,postingDate,requestedDeliveryDate`.
12The result has the order's `id` and `number`.
13
14## 2. Line
15The child create tool with `SalesOrder_id` and `documentId` (both the order's `id`), `itemId`, `lineType` `Item`, `quantity` and `unitPrice` (the price you were given: send it explicitly), `unitOfMeasureCode` `PCS`.
16
17## Known errors
18| Error | Fix |
19|---|---|
20| `You must specify an Id or a Document Id to get the lines` | list lines through the child list tool, with the order's `id` |
21| `Could not find a property named 'documentNumber'` | a line has `documentId`, not a number. Resolve the number through the header |
22
23## Facts that help
24- `fullyShipped` reads `true` on a draft: ignore it.
25- A new line's `shipQuantity` and `invoiceQuantity` already equal the quantity. That is not evidence that anything was posted.

It names the tools, and it records two errors I met and the facts that helped. A work instruction is where small lessons go so that nobody learns them twice.

The hand-over

Every task ends the same way. The note has five headings, in this order: What I did, What is left, and why, Check these first, Links and Steps. It opens with "You can create and change DRAFTS. You cannot post, ship, invoice or delete." and ends with "If you could not do what was asked, say so in the first line."

Scroll sideways, or tap the diagram to open it full size

Prompt D

I send the same request as Part 2. Only the folder is different.

Sell 2 BERLIN Guest Chair, yellow to Adatum Corporation at list price.

The AI reads the front page, the connection note, the index, the SOP and the work instructions, and then goes to Business Central. Step 2 of the SOP tells it to check the customer's existing drafts for the same item. Adatum already has drafts for two chairs from my earlier tests. The SOP does not say what to do about that. The AI stopped and asked on its own judgment, and it asked in one round, as the front page says.

I chose to create another one. Its second question is the house rule:

The request named no delivery date. So the AI works out today's date (2026-11-18), adds five days, offers 2026-11-23 as the recommended answer, and waits for me. I accepted it. Then it made the draft and ended with the hand-over:

The hand-over says which date it used and where it came from. And here is the order in Business Central. Order Date is 11/18/2026 and Requested Delivery Date is 11/23/2026.

Next: Part 5 shows how to get a fresh sandbox to test all this in.