Workspaces in Business Central AL Explained
Workspaces in Business Central AL Explained
Introduction
When developing in Microsoft Dynamics 365 Business Central, you spend a lot of time working in Visual Studio Code. To streamline productivity and keep projects well-organized, workspaces in Business Central AL play a critical role.
In this blog, we’ll explore what workspaces are, why they matter, and how you can use them effectively in your AL development journey.
What is a Workspace in Business Central AL?
A workspace in Visual Studio Code is essentially a container that holds your project’s structure, settings, and configurations. In Business Central AL development, a workspace defines:
Your AL project files (app.json, launch.json, HelloWorld.al, etc.)
Project-specific settings like symbols, runtime version, and compiler settings.
Extension dependencies and publisher details.
In short, a workspace ensures that everything needed to build and deploy an extension is neatly bundled together.
Benefits of Using Workspaces
Customization: Each workspace can have unique settings, avoiding conflicts across projects.
Organization: Keeps your extension’s source code, dependencies, and configs in one place.
Collaboration: Workspaces make it easier for teams to clone and contribute to a project without breaking setups.
Multi-root Projects: With VS Code, you can create a workspace that hosts multiple AL projects (useful for layered extensions or app suite development).
Creating and Managing Workspaces
Open VS Code.
Use Ctrl+Shift+P → search for AL: Go! → select.
Provide details (project name, target platform, runtime version).
A folder with workspace files will be generated.
Tip: Save your workspace using File > Save Workspace As… so you can reopen it quickly in future.
Example: Multi-root Workspace
When working with multiple extensions in a workspace, handling dependencies used to mean installing each required app one by one. Now, the development environment can automatically look at the dependency graph in your workspace and publish the necessary projects along with the one you selected. This way, you can focus on building and testing without worrying about missing dependencies.
Imagine you’re working with multiple extensions in your Business Central environment:
Base App holds your custom objects.
App 1 adds Sales features.
App 2 introduces extra functionality.
App 3 focuses on reporting.
From the diagram:
Base App depends on App 1, App 2 and App 3.
App 1 depends on both App 2 and App 3.
App 2 depends on App 3.
App 3 depends on App 2.
Base App
ALProject1
ALProject2
ALProject3
Adding Folder to Workspace.
Saving Workspace.
Creating a separate folder to store workspaces.
Publishing Full Dependency.
This allows you to debug, build, and manage all the extensions from a single VS Code instance.
Best Practices for Workspaces
Always version-control your workspace files (app.json, launch.json) with Git.
Use separate workspaces for test vs. production extensions.
Document dependencies in app.json to avoid deployment conflicts.
Keep workspace settings lightweight — don’t overload with machine-specific paths.
Conclusion
Workspaces in Business Central AL are more than just folders — they are the foundation of your development environment. By structuring your projects with well-maintained workspaces, you ensure smoother collaboration, better organization, and efficient extension deployment.
If you’re just starting with AL, experiment with si