Update Lifecycle for Customizations

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Update Lifecycle for Customizations in Dynamics 365 Business Central

Introduction: Why the Update Lifecycle Matters

In the world of Enterprise Resource Planning (ERP) systems, the ability to tailor software to meet specific organizational needs is often cited as a primary requirement. Dynamics 365 Business Central provides a powerful platform for developers to extend standard functionality through extensions. However, the true challenge is not just building these customizations, but maintaining them as the underlying platform evolves. Microsoft releases major updates twice a year, alongside monthly service updates, which means your code is constantly being tested against a changing environment.

Understanding the update lifecycle is critical because it determines the long-term viability of your business applications. If you build customizations without a clear strategy for updates, you risk creating "technical debt"—a scenario where the cost of future maintenance and upgrades becomes prohibitively expensive. When you neglect the update lifecycle, you may find yourself stuck on an older version of Business Central, unable to take advantage of new features, security patches, or performance improvements. This lesson will explore how to design, test, and deploy customizations that thrive within the continuous update model of modern SaaS ERP environments.

Not read yet

The Modern Architecture of Business Central

Before diving into the lifecycle, it is important to understand that Business Central has moved away from the monolithic, "C/SIDE" environment of the past. Today, the platform is built on an extension-based model using the AL language. In this architecture, your customizations exist as independent modules that sit "on top" of the base application provided by Microsoft.

Because Microsoft manages the core platform, they reserve the right to change, refactor, or even deprecate certain parts of the base application. When you write code, you are effectively creating a dependency on the Microsoft base app. The update lifecycle is the process of ensuring that when Microsoft updates their code, your code remains compatible, functional, and performant.

Callout: The "Extension" Philosophy In older versions of Dynamics NAV, developers often modified the base objects directly. This made upgrades a nightmare because you had to manually merge your changes with the new standard code. In Business Central, we use "Extensions." Extensions never modify the base code; they only communicate with it through defined hooks, events, and interfaces. This separation is the foundation of the modern update lifecycle.

Not read yet

The Phases of the Update Lifecycle

The lifecycle of a customization can be broken down into four distinct phases: Planning and Design, Development, Testing and Validation, and Deployment. Each phase carries specific responsibilities for the developer to ensure a smooth transition during platform updates.

1. Planning and Design: Thinking Ahead

The most effective way to manage updates begins before a single line of code is written. You must design your customizations to be loosely coupled with the base application. If your code is tightly integrated with specific internal logic of the base app, you are more likely to break when that logic changes.

  • Favor Events over Modifications: Always look for published events in the base application. If you need to change how a document posts, don't try to rewrite the posting procedure. Instead, subscribe to the "OnBeforePost" or "OnAfterPost" events.
  • Encapsulation: Keep your custom logic in your own codeunits. If you need to access data, use public procedures. This allows you to change the internal logic of your extension without breaking other parts of your system.
  • Avoid "Over-Engineering": Only build what is necessary. Every line of code you add is a line of code that must be maintained and validated during every future update cycle.

2. Development: Writing Future-Proof Code

When writing AL code, you should follow strict patterns that minimize the surface area for potential conflicts. Use the ObsoleteState property to handle your own code changes and pay close attention to how you interact with base tables and pages.

Tip: Use Semantic Versioning Always assign a version number to your extensions. This helps you track which version of your code is deployed in which environment. A standard format is Major.Minor.Build.Revision. When you make a breaking change, increment the Major version. When you add functionality, increment the Minor version.

3. Testing and Validation: The Sandbox Strategy

Testing is the most important part of the lifecycle. Business Central provides "Sandbox" environments that mirror your production environment. You should never update your production environment without first deploying to a sandbox and running your full test suite.

  • Automated Testing: Use the Test Tool in Business Central to create automated unit tests. If you have a custom calculation, write a test that verifies the result. When a platform update occurs, you can run these tests in minutes to see if anything broke.
  • Regression Testing: This involves testing existing functionality to ensure that new updates haven't introduced side effects. Focus your regression testing on the areas where your extensions interact with the base app.

4. Deployment and Monitoring

Once you have validated your code in the sandbox, you can deploy it to production. Even after deployment, the lifecycle continues. You must monitor your telemetry data to identify errors that users might encounter.

Not read yet

Handling Breaking Changes from Microsoft

Occasionally, Microsoft will introduce a "Breaking Change." This occurs when they modify a procedure signature, remove an object, or change the data type of a field in the base application. Your code will fail to compile or run if it relies on these removed or changed elements.

How to Identify and Fix Breaking Changes:

  1. Read the Release Notes: Microsoft publishes detailed release notes for every major update. They explicitly list objects that are being marked as obsolete or modified.
  2. Use the Compiler: When you open your project in VS Code against a new version of the base app, the compiler will highlight errors immediately. Do not ignore these warnings.
  3. Refactor Gracefully: If a procedure is marked as obsolete, it usually provides a suggested replacement. Use the ObsoleteState = Pending property to phase out your old code while introducing the new approach.

Warning: The "Ignore" Trap A common mistake is to ignore compiler warnings about obsolete code, thinking, "It still works, so I'll fix it later." This leads to a build-up of technical debt. When Microsoft eventually removes the obsolete code entirely, your app will stop building, and you will be forced to perform a rushed, high-pressure refactor. Always address warnings as soon as they appear.

Not read yet

Best Practices for Customization Maintenance

To maintain a healthy update lifecycle, adopt these industry-standard practices:

  • Modularize Your Code: Break large extensions into smaller, functional modules. This makes it easier to update, test, and troubleshoot specific areas of your system.
  • Document Dependencies: Clearly state which versions of the base application your extension supports. Use the dependencies property in your app.json file.
  • Consistent Naming Conventions: Use prefixes for all your objects and variables. This prevents naming collisions with base objects or other third-party extensions.
  • Telemetry Integration: Use the Application Insights integration in Business Central. It allows you to track errors and performance issues in real-time. If an update causes a spike in "Event ID" errors, you will be the first to know.

Comparison: The Old Way vs. The Modern Lifecycle

Aspect Legacy Approach (C/SIDE) Modern Approach (AL/SaaS)
Modification Direct changes to core code Extension-based development
Upgrades Manual code merges/re-coding Automated, continuous updates
Testing Manual testing by users Automated regression test suites
Conflicts Frequent, high-risk Minimized through isolation
Deployment Downtime required for install Parallel deployment/side-by-side

Not read yet

Step-by-Step: Preparing for a Major Update

When a major update (e.g., from version 23.0 to 24.0) is announced, follow these steps to ensure your customizations survive the transition:

Step 1: Create a Sandbox Copy

Create a new sandbox environment that is a direct copy of your production environment. This ensures you are testing against the same data and configuration.

Step 2: Update the app.json File

Update the runtime property in your app.json file to match the new version. Also, verify that your target platform version is set correctly to the new release.

{
  "name": "MyCustomization",
  "publisher": "MyCompany",
  "version": "2.0.0.0",
  "runtime": "13.0",
  "dependencies": [],
  "id": "your-guid-here"
}

Explanation: The runtime field tells the Business Central compiler which version of the platform features you are allowed to use. Increasing this allows you to use new functions introduced in the latest release.

Step 3: Recompile and Analyze Warnings

Open your project in Visual Studio Code and point your symbol references to the new version of the base application. Perform a full "Rebuild" of your project. Review every single warning and error in the "Problems" tab.

Step 4: Run Automated Tests

Execute your test codeunits. If you do not have automated tests, this is the time to start building them. Focus on the core business processes that your extension modifies.

Step 5: Validate User Interface and Data

Log into the sandbox and perform manual "smoke tests." Open the pages you have customized, enter data, and post transactions. Ensure that the layout remains consistent and that no validation errors occur during the entry process.

Step 6: Deploy to Production

Once you have confirmed that the sandbox is stable, you can safely deploy the updated extension to your production environment.

Not read yet

Common Pitfalls and How to Avoid Them

Pitfall 1: Relying on "Hidden" Logic

Sometimes developers look at the base code and find a useful local procedure. They might use "reflection" or other creative ways to call that local procedure. This is dangerous because Microsoft can rename or delete local procedures without warning, as they are not considered public APIs.

  • The Fix: If you need access to a function that isn't public, submit a request to Microsoft through the GitHub repository to have that function exposed as an event or a public procedure.

Pitfall 2: Over-reliance on UI Modifications

Designing customizations that rely heavily on page layouts can be risky. If Microsoft redesigns a page to accommodate a new feature, your carefully placed fields might be shifted or hidden.

  • The Fix: Use page extensions to add fields to established groups, but avoid trying to force complex layout changes that override the standard user experience.

Pitfall 3: Neglecting Data Upgrades

Sometimes a platform update changes the way data is stored. If you have custom tables, you need to ensure that your data remains intact during the upgrade process.

  • The Fix: Always use the UpgradeCodeunit to handle data migration. This codeunit runs automatically during the extension update process and allows you to move data from old fields to new ones, or perform data cleanup.
codeunit 50100 "UpgradeData"
{
    Subtype = Upgrade;

    trigger OnUpgradePerCompany()
    begin
        // Logic to migrate data from an old field to a new field
        // during an extension update
    end;
}

Explanation: This codeunit is specifically designed to run when an extension version is updated. It provides a safe, transactional way to modify your custom data structures without losing information.

Not read yet

The Role of Telemetry in the Lifecycle

Telemetry is often overlooked by developers, but it is the "eyes and ears" of your customizations in a live environment. By connecting your Business Central environment to an Azure Application Insights instance, you gain access to detailed logs regarding the execution of your code.

When an update is released, you can monitor the "AL Runtime" logs. If your code is running slower than before, or if it is triggering exceptions, the telemetry data will show you exactly which procedure is causing the issue. This allows you to be proactive rather than reactive. Instead of waiting for a user to call the help desk, you can identify and patch the performance bottleneck before it impacts the business.

Building for Stability: A Developer's Mindset

To be a successful developer in the Business Central ecosystem, you must shift your mindset from "building a static application" to "maintaining a living service." The update lifecycle is not a hurdle; it is a feature of the modern cloud experience. It ensures that your users are always working on a system that is secure, fast, and compliant with the latest regulations.

When you embrace the lifecycle, you stop fearing the "update notification" and start viewing it as an opportunity to refine your code. By keeping your extensions lean, well-documented, and thoroughly tested, you ensure that your organization remains agile. You will be able to adopt new features faster than your competitors, and your technical debt will remain low, allowing you to focus on delivering actual value to the business rather than constantly fixing broken code.

Not read yet

Key Takeaways

  1. Extensions are the Standard: Always use extensions to build customizations. Never modify the base application code directly, as this creates massive challenges for future updates.
  2. Design for Change: Use events and interfaces to communicate with the base application. The less you "touch" the core, the less likely you are to break when the core is updated.
  3. Automated Testing is Non-Negotiable: Manual testing is too slow and error-prone for the continuous update cycle. Invest in automated test codeunits to validate your logic every time you make a change.
  4. Proactive Maintenance: Treat compiler warnings about obsolete code as critical bugs. Fixing them early prevents major system failures during platform upgrades.
  5. Use the Sandbox: Never deploy updates to production without fully testing them in an environment that mimics your real-world data and usage patterns.
  6. Telemetry is Your Best Friend: Use Azure Application Insights to monitor the health of your extensions. This gives you the visibility needed to fix issues before they become business problems.
  7. Embrace the Lifecycle: View updates as a normal, healthy part of the ERP lifecycle. By building for stability and following these best practices, you create a sustainable and highly reliable system for your organization.

Not read yet

FAQ: Common Questions about the Update Lifecycle

Q: How often should I update my extensions? A: You should aim to keep your extensions compatible with the latest minor and major versions of Business Central. At a minimum, you should test against every major release to ensure your code remains functional.

Q: What happens if I don't update my extension? A: If you fall too far behind, Microsoft may eventually block your environment from receiving further updates until your extensions are compatible with the newer platform requirements. This can lead to security vulnerabilities and inability to use new features.

Q: Can I use third-party extensions in my lifecycle? A: Yes, but remember that you are also responsible for the compatibility of third-party apps. If a third-party app breaks during an update, you will need to contact the vendor or remove the app. Always check if your third-party apps are compatible with the next version of Business Central before updating.

Q: Is there a way to automate the update process? A: Yes, you can use CI/CD (Continuous Integration/Continuous Deployment) pipelines, such as Azure DevOps or GitHub Actions, to automatically build, test, and deploy your extensions to sandbox environments. This is the industry standard for managing large-scale customizations.


Conclusion

The update lifecycle is the heartbeat of a healthy Business Central environment. By understanding how to design, build, test, and deploy your customizations within this framework, you transform the challenge of constant updates into a competitive advantage. Remember that your goal is to create a system that is not only functional but also resilient—a system that can grow and change alongside your business and the platform itself. Keep your code clean, your tests automated, and your monitoring active, and you will find that the update lifecycle becomes a manageable, even routine, part of your professional life as a developer.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.