Erik's ToolBox Documentation
Index

Key Features

Erik's ToolBox provides a comprehensive set of features for working with Microsoft Dynamics 365 Business Central. This page summarizes every major capability, organized by feature group, so you can quickly find the functionality that matches your needs.


1. Interactive Code Editor

The Interactive Code Editor is the core experience of Erik's ToolBox. It provides a browser-based environment where you can write and execute AL code instantly within Business Central.

  • Full-featured code editor running in the Business Central web client
  • Syntax highlighting for AL language keywords, types, and built-in functions
  • IntelliSense auto-completion powered by downloaded symbols from your environment
  • Instant code execution with results displayed directly in the editor output
  • REPL-style workflow that lets you iterate on code in real time
  • Support for multi-line scripts, procedures, and complex logic
  • Error reporting with line numbers and descriptive messages
  • Copy and paste support for moving code between the editor and external tools

The editor is your primary workspace for all interactive scripting tasks. You can use it for everything from quick one-line data lookups to multi-procedure scripts that process thousands of records.


2. AL Language Support

The ToolBox includes a comprehensive AL language implementation with a rich set of built-in capabilities:

Built-in Functions

The runtime provides more than 60 built-in functions covering common operations:

Category Examples
Output message, error
String format, strsubstno, copystr, strlen, strpos, delchr, padstr, incstr, uppercase, lowercase
Numeric abs, round, power, random, randomize
Date/Time today, time, currentdatetime, calcdate, createdatetime, dmy2date, date2dmy, dt2date
Type Conversion evaluate, format
System sleep, commit, userid, companyname, guiallowed, sessionid, createguid, startsession
Dialog confirm, strmenu
Arrays / Streams arraylen, compressarray, copyarray, copystream, uploadintostream, downloadfromstream
Excel exget, exset, exclear, exopen

Record Methods

You have access to more than 40 record methods for working with Business Central table data:

  • Navigation -- findfirst, findlast, findset, find, next, get, getbysystemid, isempty, count, countapprox
  • Filtering -- setrange, setfilter, getfilter, getfilters, getrangemin, getrangemax, setrecfilter, filtergroup, setcurrentkey, ascending, reset
  • Marking -- mark, markedonly, clearmarks
  • Modification -- init, insert, modify, delete, deleteall, modifyall, validate, testfield, fielderror, transferfields, copy
  • Calculation and Metadata -- calcfields, calcsums, fieldcaption, tablecaption, recordid, istemporary
  • Scope -- locktable, changecompany, changeenvironment

Temporary records (Record Customer temporary) provide in-memory datasets.

Text Methods

The runtime supports 17 text methods for string manipulation on Text variables:

  • contains, endswith, startswith
  • indexof, indexofany, lastindexof
  • padleft, padright
  • remove, replace
  • split, substring
  • tolower, toupper
  • trim, trimstart, trimend

Types

Besides the scalar types (Integer, BigInteger, Decimal, Text, Code, Boolean, Date, Time, DateTime, Duration, Guid, Option, DateFormula, Char, Byte), scripts can use Record, Dialog, one-dimensional arrays, List of [T], Dictionary of [K, V], the four JSON types, InStream/OutStream, and variables for a set of standard codeunits (Math, Rest Client, Temp Blob, Regex, Email, and more).

Control Flow

You can use standard AL control flow statements to build structured scripts:

  • if / then / else conditional blocks
  • case statements with multiple branches, value lists, and ranges
  • for / to / downto loops
  • foreach / in collection iteration
  • while / do loops
  • repeat / until loops
  • begin / end compound statements
  • Codeunit.Run, Page.Run, Page.RunModal, Report.Run, Report.RunModal
  • Procedure definitions with parameters (including var) and return values
  • Local and global variable declarations

3. Symbol Management

Symbol management lets you download and maintain metadata from your Business Central environment to power IntelliSense in the code editor.

  • Download symbols from your Business Central environment (SaaS or On-Premises)
  • IntelliSense support for tables, fields, pages, reports, codeunits, and enums
  • Auto-completion of table names when declaring record variables
  • Field name suggestions when accessing record fields
  • Automatic symbol refresh to keep IntelliSense current with environment changes
  • Symbol data stored per-environment for multi-environment support

With symbols downloaded, the editor can suggest table names, field names, and other object references as you type, significantly speeding up your scripting workflow.


4. AI Agents

Two AI agents work next to the editors, built on the AL AI Services app. The ToolBox Agent on the Interactive Code page and the SQL Agent on the SQL Workbench do not just suggest code in a chat: they act through tools that read and rewrite the editor, compile and run, look up your data model, and manage saved programs and statements.

Supported AI providers:

Provider Provider
Azure Open AI xAI Grok
ChatGPT Open AI Mistral
Anthropic (Claude) DeepSeek
LM Studio (local) Moonshot Kimi
Google Gemini Alibaba Qwen
Zhipu GLM MiniMax

Agent capabilities:

  • Write complete ToolBox programs or SQL statements from a description and place them in the editor
  • Compile and run programs, execute statements, and read the console output or result to verify their work
  • Look up tables, fields, keys, option values, and sample rows so generated code uses names that exist in your environment
  • Explain and fix the program or statement in the editor, including the diagnostics of the last run
  • Open, reuse, and save programs and SQL statements
  • Accept image and PDF attachments (provider dependent)
  • Save every conversation automatically; resume it later from the panel or the AI Conversations page

You configure the agents on the AI Providers page (reached from ToolBox Setup) by entering the provider's endpoint, key, and model and turning on the ToolBox Agent toggle. See AI Agents Overview.


5. Excel Integration

Erik's ToolBox includes built-in functions for reading and writing Excel files directly from your AL scripts.

  • exget('A1') / exget(row, col) -- Read a value from a specific cell in the loaded Excel file
  • exset('A1', value) / exset(row, col, value) -- Write a value to a specific cell
  • exclear() -- Clear the current Excel data in memory
  • exopen() -- Open and display the Excel data

Common use cases for Excel integration:

  • Import data from Excel spreadsheets into Business Central tables
  • Export query results to Excel format for reporting
  • Transform and validate Excel data before importing
  • Create Excel-based reports from Business Central data
  • Batch process Excel files with custom logic

Excel integration works entirely within the browser. You upload your Excel file, process it with your script, and download the results -- all without leaving Business Central.


6. Batch Processing

The Batch Processing feature provides a guided wizard for performing bulk search-and-replace operations across Business Central table data.

  • Step-by-step wizard interface that guides you through the entire process
  • Select the target table and fields for the operation
  • Define search criteria to identify records to modify
  • Specify replacement values for matched records
  • Preview changes before committing them to the database
  • Transaction-safe execution that rolls back on errors
  • Audit logging of all batch operations for compliance and traceability

Batch Processing is designed for situations where you need to update many records with similar changes, such as correcting a misspelled vendor name across all related records or updating a default value in a configuration field.


7. SQL Workbench

The SQL Workbench lets you execute SQL queries directly against your Business Central data from within the application.

Supported SQL operations:

Operation Description
SELECT Query data from tables with filtering, sorting, and aggregation
INSERT Add new records to tables
UPDATE Modify existing records based on conditions
DELETE Remove records matching specified criteria

SQL Workbench features:

  • Write and execute SQL statements in a dedicated query editor
  • View results in a tabular format within Business Central
  • Support for joins, subqueries, and aggregate functions
  • Query history for re-running previous statements
  • Results export for further analysis

The SQL Workbench is particularly useful for complex data analysis that would be cumbersome to express in AL code, or for administrators who are more comfortable with SQL syntax.


8. Run Programs

The Run Programs feature lets you save your scripts as reusable programs that can be assigned to users and scheduled for automated execution.

  • Save any script as a named program with a description
  • Assign programs to specific Business Central users
  • Users can run their assigned programs from a dedicated program list
  • Schedule programs for automated execution via the Business Central Job Queue
  • Pass parameters to programs at runtime
  • View execution history and results for each program run
  • Manage program permissions independently of ToolBox editor access

Run Programs transforms one-off scripts into repeatable, managed processes. This is ideal for tasks that need to run on a schedule (such as nightly data cleanup) or tasks that need to be delegated to users who should not have full editor access.


9. Object Inspector

The Object Inspector lets you browse and explore all Business Central objects in your environment.

  • Browse tables, pages, reports, codeunits, queries, enums, and XMLports
  • View object metadata including ID, name, type, and properties
  • Filter and search objects by name, ID, or type
  • Data Inspector -- Open any table to view its data in a grid format
  • Edit table data directly through the Data Inspector interface
  • View table field definitions including data types, lengths, and properties
  • Explore object relationships and dependencies

The Object Inspector is invaluable for understanding the structure of your Business Central environment, especially when working with customized or ISV-provided extensions whose schema you need to explore.


10. Remote Packages

Remote Packages enable data transfer between different Business Central environments and tenants.

  • Package table data from one environment for transfer to another
  • Support for cross-tenant data migration scenarios
  • OAuth2 authentication for secure connections between environments
  • Selective data packaging -- choose which tables and records to include
  • Data validation during transfer to ensure integrity
  • Transfer history and status tracking

Remote Packages are particularly useful for:

  • Migrating configuration data between development, staging, and production environments
  • Synchronizing reference data across multiple tenants
  • Creating reusable data packages for consistent environment setup
  • Transferring master data during tenant onboarding

11. Data in GitHub

The Data in GitHub feature provides version control for Business Central table data using GitHub as the backend repository.

  • Commit -- Push current table data to a GitHub repository as a versioned snapshot
  • Pull -- Retrieve table data from a GitHub repository and apply it to your environment
  • Monitor -- Track changes to table data over time and review the change history in GitHub

Setup requirements:

  • A GitHub account with a personal access token
  • A designated GitHub repository for storing Business Central data
  • Configuration of the GitHub connection in ToolBox Setup

Data in GitHub is useful for tracking configuration changes over time, maintaining an audit trail of data modifications, and synchronizing reference data across environments using standard Git workflows.


12. Email Connectors

Erik's ToolBox adds three API-based email connectors to Business Central's standard email framework, so you can send mail without SMTP. Each appears as a new account type on the Email Accounts page.

  • Microsoft Graph -- Send from a Microsoft 365 user or shared mailbox using an Entra ID app registration (application Mail.Send permission)
  • Google Workspace -- Send as a Google Workspace user through the Gmail API, using a service account with domain-wide delegation
  • Moosend -- Send transactional email through the Moosend (Sitecore Send) API with a single API key

Each connector authenticates as an application (no user login), stores its secret in IsolatedStorage, and provides Setup Guide, Test Connection, and Send Test Email actions plus an Enabled mode (including No Sending and Redirect) for safe testing. See Email Connectors.


13. Setup and User Management

Erik's ToolBox provides a comprehensive setup and user management system to control access and maintain security.

Access Levels

Level Description
ReadOnly Users can execute scripts that read data but cannot modify any records
WriteNormalTables Users can read and write to standard (non-system) tables
GodMode Full unrestricted access to all tables and operations

Management Features

  • User Setup -- Add and configure individual ToolBox users with appropriate access levels
  • Audit Trail -- Automatic logging of all code executions, including the user, timestamp, and script content
  • License Management -- License validation through check.hougaardlicense.com
  • Environment Configuration -- Configure AI providers, GitHub connections, remote package endpoints, and other integrations through the central Setup page
  • Permission Integration -- ToolBox access levels work alongside standard Business Central permission sets

The setup system ensures that you can provide ToolBox access to your team while maintaining appropriate controls over what each user can do with the tool.


Feature Availability Summary

The following table summarizes which features are available based on deployment type:

Feature SaaS On-Premises
Interactive Code Editor Yes Yes
AL Language Support Yes Yes
Symbol Management Yes Yes
AI Agents Yes Yes
Excel Integration Yes Yes
Batch Processing Yes Yes
SQL Workbench Yes Yes
Run Programs Yes Yes
Object Inspector Yes Yes
Remote Packages Yes Yes
Data in GitHub Yes Yes
Email Connectors Yes Yes
Setup and User Management Yes Yes