Microsoft Dynamics AI Cloud Partner

Microsoft Dynamics 365 Business Central Edition

Insights, updates, and practical guides for Microsoft Dynamics 365 Business Central

Dynamics 365 for startups and SMBs Business Console Business Central Implementation

The Ultimate Guide to Page Scripting in Business Central (for UAT & Beyond)

Page Scripting in Business Central – If you have ever managed a User Acceptance Testing (UAT) cycle for a Microsoft Dynamics 365 Business Central implementation, you already know the familiar, painful pattern.

A key user tests a scenario, and it “mostly works”. 

A week later, after a minor configuration change or an extension update, someone tests it again and it breaks. The team scrambles to reproduce the issue, compare steps, and figure out whether it is a data problem, a permissions issue, or a genuine code regression. 

Traditional, manual UAT is time-consuming, highly inconsistent, and prone to human error.

That is exactly where the Page Scripting tool in Business Central changes the game.

Page Scripting is Microsoft’s in-client capability to record what a user does in the Business Central UI and replay it automatically. In this comprehensive guide, we will walk you through everything from the basics of recording a script to advanced techniques like Power Fx integrations, validations, and headless CI/CD execution.

What is Page Scripting in Business Central?

At its core, Page Scripting is a native web-client tool that records user actions such as creating records, entering values, and posting transactions. After which it replays those highly specific steps automatically. It is designed to validate end-to-end business processes, making it the perfect foundation for structured UAT and regression testing.

Business Central captures these steps as a YAML file. You can save this file, share it with your team, or upload it to other sandbox environments to guarantee that a specific business process behaves exactly as expected, every single time.

Automating your testing cycles doesn’t just save time during a single sprint; it structurally lowers your long-term maintenance costs, positively impacting your overall Business Central Total Cost Of Ownership.

Who Should Use Page Scripting?

While the word “scripting” sounds like a developer-only feature, page scripting in business central is actually designed for cross-functional teams:

  • Functional Consultants: Automate common UAT flows and validate business processes.
  • Power Users: Record “how we actually work” in the live UI and turn it into a repeatable baseline test.
  • Developers & DevOps: Use UI scripts as a regression suite especially when paired with command-line replay tools and release pipelines.

Your First Script: A Step-by-Step Guide

Before you record your first script, ensure you have the PAGESCRIPTING - REC (Record) and PAGESCRIPTING - PLAY (Playback) permission sets assigned in your sandbox environment.

Part 1: Recording the Workflow

Let’s record a simple, meaningful workflow:
Creating a New Customer”

Step 1: Open the Tool

Page Scripting in Dynamics 365 Business Central settings

Click the Settings icon (gear) in the top right corner of Business Central and select Page Scripting.

Step 2: Start Recording

Start Recording Page Scripting in Business Central

In the Page Scripting pane, click the Start new button.

Step 3: Perform Your Actions

Customer Navigation Action Page Scripting in Dynamics 365 Business Central

Navigate to the Customers list, click New, and fill in standard fields like the Customer Name, Address, and Posting Groups. Finally, save the record.

Step 4: Observe the Capture

Page scripting observe recorded steps

As you click and type, you will see steps sequentially populate in the right-hand scripting pane. Think of this as a visual timeline of your UI actions.

Step 5: Save the Script

Page Scripting Save Recording

Click Stop and save your script. This will typically export a .yaml file to your local machine.

Part 2: Playing Back the Script

To test your newly created automation, reload the YAML file into the Page Scripting pane and click Play.

You will watch the UI rapidly execute your exact steps. Green checkmarks indicate that the UI matched the expected behavior, while red indicators will highlight where a field, page, or action failed.

Note: Playing back a script modifies data exactly as if a real user performed those actions. Always run these primarily in Sandbox or UAT environments to avoid unwanted production data entry. Using tools like this is an excellent strategy to Reduce Manual Work in Business Central Without Customization.

Omni logic solutions logo favicon

Stop Wasting Hours on Manual UAT Cycles - Get A Free Consultation

Transition to automated testing seamlessly by building a resilient Page Scripting framework that safeguards your Business Central environment against upgrade errors.

Advanced Techniques: Unleashing the True Power of Page Scripting

The “Record and Replay” function is just the beginning. Real-world UAT automation requires guardrails, dynamic data, and logical assertions to ensure tests do not break just because a document number changed.

1. Dynamic Data with Power Fx

A major reason UI automation fails is hard-coded values. The moment you replay a script, you might hit duplicate document errors. By leveraging Power Fx (Microsoft’s low-code expression language), you can compute values at runtime.

  • Random Values: Prevent duplicate errors by setting a field value to "UAT Customer " & RandBetween(1000, 9999).
  • Dynamic Dates: Keep tests evergreen by using formulas like "Sales Invoice for " & Text(Today(), "yyyy-mm-dd").

2. Validations and Assertions

Robust UAT automation doesn’t just click buttons; it verifies outcomes. Page Scripting allows you to add validation steps to ensure business logic fires correctly. For example, after posting a test invoice, you can add a step to validate that the document status successfully changed from Open to Released.

3. Conditional Logic and Wait Steps

Real environments are rarely pristine. Adding conditional steps allows your scripts to handle real-world variability (e.g., “If this specific test customer does not exist, create it; otherwise, reuse it”). Furthermore, since background processes and workflows take a moment to process, inserting calculated Wait steps prevents your script from failing due to standard system lag.

A Strategic Approach: Page Scripting in business central vs. AL Test Codeunits

Page Scripting creates the most value when integrated into a broader quality assurance strategy. You do not have to choose between UI scripts and developer-driven AL codeunits; high-performing teams use both.

 

Feature / Capability Page Scripting (UI Automation) AL-Based Test Codeunits
Testing Level UI-level (“What the user does and sees”) Code-level (“What the backend system does”)
Primary Use Case UAT workflows, visual regression testing Unit testing, complex mathematical validations
Required Skillset Functional users, No-code/Low-code AL Developers
Maintenance Can be sensitive to major UI layout changes Highly stable if the underlying APIs remain consistent

The Bottom Line: Use AL tests to ensure your custom AL code and logic are computationally perfectly correct. Use Page Scripting to ensure the end-user journey is still frictionless after an update.

Real-World Automation: Testing ISV Apps (OmniFY)

Imagine your organization is rolling out a new expense management solution like OmniFY Expense Reports. Before going live, you need to ensure it inherits your company’s specific dimensions, posting groups, and approval workflows.

Instead of testing this manually, you can build a modular Page Script suite:

  • Script A (Employee): Navigates to OmniFY, creates an expense report with mileage/meals, and submits it into the workflow.
  • Script B (Approver): Logs in from an approver context, opens pending approvals, validates the final GL totals, and clicks Approve.

Because these scripts are saved, your team can run them flawlessly before every major Microsoft Wave release, ensuring your ISV apps never conflict with core ERP updates.

Omni logic solutions logo favicon

Deploy ISV Updates and Wave Releases with Absolute Confidence -
Explore Our Implementation Services

Complex ERP customizations require rigorous, multi-layered testing. Discover how our managed Dynamics 365 services and custom AL codeunit testing keep your operations running flawlessly during every major Microsoft update.

Taking it to the Next Level: CI/CD and Headless Replay

Once you have a stable library of YAML Page Scripts, the natural progression is to run them automatically after every deployment using a CI/CD pipeline.

Using command-line utilities like the bc-replay toolset (available via NPM), developers can execute these UI scripts “headlessly” in the background. When integrated with AL-Go for GitHub, your pipeline can automatically spin up a test container, deploy your new code, run 20 essential business processes via bc-replay, and pass or fail the deployment build before a human ever has to look at it.

Conclusion: Start Automating Your Business Processes Today

Page Scripting in Business Central is one of the most accessible ways to transform UAT from a manual chore into a highly scalable, repeatable asset. You can start with simple record-and-replay tasks today, and gracefully pivot toward dynamic Power Fx validations and CI/CD execution tomorrow.

When implemented correctly, automated Page Scripting doesn’t just save time, it improves data quality, slashes go-live risk, and allows your entire business to adopt structural changes with absolute confidence.”

FAQs

Can Page Scripting interact with elements outside of Business Central?

No. Page Scripting in business central is strictly bounded to the web client UI native pages. It cannot interact with external browser tabs, third-party Power BI embedded canvas apps, or external ISV integrations that pop out of the BC environment.

How do I share my Page Scripts with other testers?

Because Page Scripts are saved as standard .yaml files, you can share them via email, Teams, or ideally, a source control repository like GitHub or Azure DevOps. Any user with the correct Page Scripting playback permissions can upload that file to their BC client and hit play.

Does playing a script permanently change database records?

Yes. Page Scripting in business central interacts with the system exactly as a human user does. If the script instructs the system to post a Sales Invoice, that invoice will be posted to the general ledger. For this reason, these scripts should be run almost exclusively in Sandbox or UAT environments.

What happens if Microsoft changes the UI in a Wave Release?

If a field is renamed, moved to a different tab, or structurally altered in a major update, the specific step in your Page Script associated with that UI element may fail. You will need to re-record or edit that specific step using the Page Scripting pane to capture the new UI layout.

  • Sage vs QuickBooks vs Business Central

    The ERP & CRM Knowledge Hub Strategy, Selection & Comparison Guides For Canadian Businesses Home Sage VS QuickBooks VS Business Central: Ultimate Comparison Guide Vishal R May 29, 2026 7:10 am Quick Answer: Sage 50 fits single-entity Canadian microbusinesses that need native CRA payroll. QuickBooks Online Advanced works for single-entity SMBs under $5M CAD revenue.

    May 29, 2026
  • QuickBooks vs Business Central : Ultimate Comparison Guide (2026)

    The ERP & CRM Knowledge Hub Strategy, Selection & Comparison Guides For Canadian Businesses Home QuickBooks vs Business Central : The Ultimate Comparison Guide (2026) Vishal R May 27, 2026 9:33 am Across our last 45 Canadian ERP deployments, the catalyst for replacing accounting software is rarely just transaction volume. A mid-market COO usually hits

    May 27, 2026
  • Power BI vs Tableau: Canadian Teams Comparison

    Microsoft Dynamics 365 Business Central Edition Insights, updates, and practical guides for Microsoft Dynamics 365 Business Central Home Power BI vs Tableau (2026): An Honest Comparison Vishal R May 27, 2026 3:44 am The April of 2025 Microsoft pricing adjustment forced Canadian CFOs to re-evaluate their entire business intelligence spend. When Power BI Pro licensing

    May 27, 2026
  • Power BI Pricing Canada (2026) : Complete CAD Cost Breakdown

    Microsoft Dynamics 365 Business Central Edition Insights, updates, and practical guides for Microsoft Dynamics 365 Business Central Home Power BI Pricing Canada : Complete Cost Breakdown (2026) Vishal R May 26, 2026 6:15 am AI-first Business Central = a Dynamics 365 Business Central deployment in which Microsoft Copilot, Copilot Studio agents, and the Business Central

    May 26, 2026
  • Top 10 ERP Systems for Canadian Businesses in 2026 — Honest Comparison

    A mid-market distributor operating in Alberta and Ontario hits $25 million CAD in revenue. The accounting department struggles with multi-currency consolidations in QuickBooks, the warehouse runs on isolated spreadsheets, and the sales team uses a disconnected CRM. They evaluate new software, select a legacy vendor based on a slick sales presentation, and spend $150,000 CAD only to realize the system requires expensive, custom coding to handle provincial tax compliance and cross-border shipping.

    May 24, 2026
  • What Does an ERP Consultant Do? A Complete Guide for Canadian Businesses

    The ERP & CRM Knowledge Hub Strategy, Selection & Comparison Guides For Canadian Businesses Home What Does an ERP Consultant Do? A Complete Guide for Canadian Businesses Vishal R May 21, 2026 6:36 am A $40 million Canadian manufacturing firm operating out of Ontario and British Columbia decides it is time to upgrade its disconnected

    May 21, 2026

Contact

319-8988 Fraserton Court, Burnaby BC V5H 5H8

consult@omnilogicsolutions.com

+1888 405 8676 | +1604 900 3785

Get in Touch!

    Author

    • Suraj Prajapati is a Senior Developer at Omni Logic Solutions, specializing in Microsoft Dynamics 365, Business Central, and custom ERP development. With deep expertise in building scalable, high-performance solutions, he helps businesses streamline operations, automate workflows, and enhance system efficiency across complex environments.