Smarter Documentation: Combining Business Central Page Scripting with AI
- 1 dzień temu
- 6 minut(y) czytania
How to turn recorded UI sessions into test scripts, user manuals, and process diagrams — without writing a line of code.
Documentation is the part of every Business Central project that everyone agrees is important and almost nobody enjoys. Process flow diagrams get outdated the moment a requirement changes, test scripts live in someone's head, and user manuals are often written days before go-live under visible panic.
Page Scripting — Microsoft's no-code recording tool in Business Central — solves part of this problem by capturing what a user actually does on screen. Combine it with an AI assistant like Microsoft Copilot or ChatGPT, and a single recording session can generate the whole documentation stack. This article walks through how that workflow looks in practice.
What Page Scripting actually is
Page Scripting is a built-in Business Central feature that records UI interactions and replays them automatically. It captures the things a user does inside the client — opening pages, clicking actions, filling fields, and navigating between pages — and produces a YAML file that can be replayed against any environment.
During playback, each step shows a pass/fail indicator, which is what makes the tool genuinely useful for User Acceptance Testing (UAT). It automates manual test scenarios, validates business processes after every change, dramatically reduces regression testing time, and requires no coding at all. The same script can be reused across sandboxes, production, and on-premises environments without modification.
Where it works
Page Scripting supports every flavor of Business Central — Online (both sandbox and production), on-premises, and Docker containers. The only things you need are two permissions: PAGESCRIPTING - REC to record and PAGESCRIPTING - PLAY to replay.
What it captures (and what it doesn't)
The tool records UI interactions, AL-triggered actions, page navigation, and field values. It's deliberately scoped to the Business Central UI, which means a few things are out of reach: generic HTML automation, control add-ins, and embedded Power BI reports can't be scripted. For everything else inside BC, it works.
Recording your first script
The recording workflow is intentionally simple. Open the Page Scripting pane from Settings, choose Start new / New recording, and the pane opens on the right to track the session.


From there, you just use Business Central the way a user would.
While recording, the pane gives you real control over the session. You can pause and resume when you need to set something up off-script, insert new steps, delete missteps, or rearrange the order. The pane can be hidden so it doesn't get in the way, and recording continues in the background until you explicitly stop it.
Once you've captured the scenario, you can play the script immediately or save it as a YAML file for later. Playback controls include Play, Previous, Next, and Rewind, and every captured step shows a clear pass/fail indicator so you can spot exactly where a process broke.
Advanced features worth knowing
A basic recording is useful. A recording that uses the advanced features is robust. The capabilities that matter most for real UAT work:
Parameters — turn a hard-coded script into a reusable template
Validation steps — assert that a field contains a specific value, not just that a click happened
Conditional steps — handle branches where the UI differs based on data
Wait steps — pause for background processes to finish before continuing
Optional pages and dialog handling — survive the "do you want to post?" dialogs that appear unpredictably

Include other scripts — compose larger scenarios from smaller building blocks
Direct YAML editing — tweak what the recorder captured without re-recording
Sharing via links — send a recording to a colleague the same way you'd share a document
These are what turn a cute demo tool into something you can actually run as part of a release process.
Where AI comes in
A YAML file full of clicks is a great input for an LLM. Once you have a recording of a real business process, you can hand that file to Microsoft Copilot, Claude or ChatGPT and ask for three distinct deliverables — each of which normally takes hours to produce by hand.
1. Process Flow Diagrams
Paste the YAML into an AI assistant and ask for a Mermaid or draw.io diagram of the flow. The AI reads the sequence of pages and actions and produces a process diagram that actually reflects what happens in the system, not what someone thought was happening six months ago. Conditional logic in the script — for example, branching VAT posting rules — translates naturally into decision diamonds in the diagram.
The advantage over hand-drawn diagrams is that when the process changes, you re-record and regenerate. The documentation stays in sync with reality.
Examples:
ChatGPT: Cration Sales Order with Shipment Agent condition
flowchart LR
A([Start]) --> B[Create Sales Order]
B --> C[Select Customer]
C --> D[Add First Sales Line]
D --> E[Set Quantity to 1]
E --> F[Set Shipping Agent]
F --> G{Shipping Agent?}
G -->|DHL| H[Add Extra Line\nQuantity 1\nUnit Price 100]
G -->|FEDEX| I[Add Extra Line\nQuantity 1\nUnit Price 200]
G -->|Other| J[No extra pricing branch]
H --> K[Finish Sales Order]
I --> K
J --> K
K --> L([End])

Claude: Cration Sales Order with Shipment Agent condition

2. Test Scripts
The YAML is already a test script in a technical sense, but a human-readable version is still useful for UAT sign-off sheets, audit trails, and onboarding. Both Claude and ChatGPT can convert the YAML into structured test cases with preconditions, steps, and expected results — the format business users and auditors expect.
In practice, Claude tend to win on BC-specific terminology and field names, while ChatGPT is often faster for quick conversions and formatting.
ChatGPT: Cration Sales Order with Shipment Agent condition
Claude: Cration Sales Order with Shipment Agent condition
3. User Manuals
The same recording becomes the basis for a step-by-step user manual. Feed the YAML to the AI along with screenshots from the playback, and you get a numbered walkthrough written in natural language — "Open the Sales Orders page, click New, enter the customer number in the Sell-to Customer No. field" — ready to drop into SharePoint, Confluence, or a Word document.
This is the part that usually gets skipped on projects because nobody has time. When the first draft takes thirty seconds to generate, it actually gets done.
ChatGPT: Cration Sales Order with Shipment Agent condition
Claude: Cration Sales Order with Shipment Agent condition
Copilot Agent: Cration Sales Order with Shipment Agent condition
Best practices
A few habits make the difference between a script that works once and a script that survives six months of environment changes:
Start from a known page like the Role Center, so playback has a predictable entry point.
Use test data, not production data — scripts capture field values, and you don't want customer names ending up in a shared recording.
Break large processes into smaller scripts and compose them with the include feature. A 200-step recording is fragile; five 40-step recordings chained together are not.
Reduce dependency on volatile data — use fixed test customers and items instead of whatever happens to be at the top of the list today.
Running scripts in CI/CD
Page Scripting isn't limited to the BC client. Microsoft ships a tool called bc-replay that runs saved scripts headlessly, which means UAT can become part of a real pipeline.
Install it with:
npm i @microsoft/bc-replay --save
Then run:
npx replay
passing the environment URL, authentication, and a results folder. The output is a pass/fail report per script, which plugs straight into Azure DevOps or GitHub Actions as a gate on releases. Every change to an extension or configuration can be automatically validated against the real business processes that matter.
Key takeaways
Page Scripting is a practical no-code layer for UAT and repeatable process checks — and on its own it's already worth the time to learn. What changes the calculation is pairing it with an AI assistant. A single recording session becomes a process diagram, a formal test script, and a user manual, all derived from the same source of truth and all regenerable when the process changes.
The full lifecycle the tool supports — record, edit, validate, save, share, replay — maps onto the full lifecycle documentation actually needs. For teams that have been treating documentation as an afterthought because the effort never felt justified, this is the workflow that makes the effort small enough to be worth it.



Komentarze