MSBA-341 · Lesson 11 of 12 · 18 min

Upgrading and compatibility

▶ Video coming soon A video version of this lesson is on the way.

With the inspection feature built and in the sandbox, Desmond asked Prudence to picture the first service update notice that would arrive in Lifecycle Services after go-live. Desmond told Prudence that this was the moment the extension model was designed for. Before One Version, customers who had overlayered Microsoft's code faced long, expensive upgrades, merging their changes into each new release line by line. Now Microsoft ships service updates on a regular cadence, every customer moves forward, and the customer's job is to make sure their extensions still compile and behave. Whether that job takes an afternoon or a month depends almost entirely on how the extensions were written.

One Version and the update cadence

Finance and operations apps run on a single, continuously updated version, called One Version. Microsoft releases service updates several times a year, each with a version number such as 10.0.44, and customers must stay within a supported range of recent versions. Customers can choose when, within a window, to apply each update to sandbox and production, and they can pause a limited number of updates, but they cannot stay on an old version indefinitely. New features arrive in updates, often first as feature management items that administrators turn on when ready, and some become mandatory in later versions.

A horizontal timeline with six markers labeled preview, GA and auto-update, twice. A note below says: preview, build and run tests in a sandbox; GA, fix breaks; before auto-update, the regression suite passes.
Cobalt Ridge's routine for each service update.

What can break

Extensions do not touch Microsoft's code, so a service update cannot overwrite them. They can still be affected in several ways, and knowing these ways is the core of compatibility work.

Ways a service update can affect extensions.
Change in the updateEffect on an extensionHow it shows up
A wrapped method's signature changesThe wrapper no longer matchesCompile error in the extension model
A method or class is marked obsoleteCode still works for now but will break laterCompiler warning from the SysObsolete attribute
A method is made private, final or Hookable(false)Wrapping or handling it is no longer allowedCompile error; rare and normally announced
Logic moves to a different methodThe wrapper compiles but no longer runs at the right momentOnly tests reveal it
A standard report design changesA copied design misses the changeVisual comparison or user reports
A feature becomes mandatoryCode paths the extension relied on may changeTests and the deprecated features list

The dangerous row is the fourth. A compile error is noisy and gets fixed. A wrapper that still compiles but is no longer called, because Microsoft restructured the standard code so that the work now happens elsewhere, fails silently. Cobalt Ridge's receipt block from lesson 3 would be exactly that kind of risk: if Microsoft moved the line check to a new method, the wrapper would sit unused and castings would post without certificates. Only an automated test that tried to post a receipt for a line without a certificate would catch it.

Obsolete APIs and deprecation

Microsoft marks methods, classes and other elements that will be removed with the SysObsolete attribute, which can make their use a compiler warning or an error, and usually names the replacement. Microsoft also publishes a list of removed or deprecated features for each release, with the planned timing. Cobalt Ridge treated every obsolete warning in CobaltRidgeCustom as a defect to fix before the next update, not something to ignore, because warnings become errors in later versions. Prudence ran the build with warnings visible and kept a short list of warnings that pointed into standard code, which were Microsoft's to fix.

Writing extensions that survive updates

Desmond's checklist for update-resilient extensions drew on everything in the course. Wrap the most specific, most stable method available, preferably one Microsoft has designed for extension, such as a method with a clear single purpose or one marked Replaceable. Prefer delegates and designed extension points over wrapping internal helpers. Never depend on wrapper order or on other models' side effects. Keep extension logic in your own classes, so wrappers are a single line that calls them, which makes them easy to move if the standard code moves. Avoid copying standard code into an extension, because a copy freezes Microsoft's old logic. Avoid duplicating standard report designs when a report extension will do.

A thin wrapper delegating to a rule class. The method name here is illustrative and must be verified against the standard class.
[ExtensionOf(classStr(PurchPackingSlipJournalPost))]
final class PurchPackingSlipJournalPost_CRInspection_Extension
{
    // The wrapper stays thin; the rule lives in CRInspectionReceiptRule,
    // which has its own tests and can be called from a new place
    // if Microsoft restructures the posting class.
    // Confirm the exact method and signature in the reference metadata.
    protected boolean checkLine(PurchLine _purchLine)
    {
        boolean ok = next checkLine(_purchLine);
        return ok && CRInspectionReceiptRule::construct(_purchLine).validate();
    }
}

Extensibility requests

Sometimes the right extension point does not exist: the logic needed is inside a private method, a method marked final without Wrappable(true), or the middle of a long method with no hook. Microsoft accepts extensibility requests from customers and partners, asking for a delegate, a refactored method or a change in an attribute. Requests are logged through Microsoft's support channels for finance and operations apps, are reviewed by the product team and, when accepted, are delivered in a future service update. The request should state the business scenario, the exact place in the code and the change wanted, such as making a method protected or adding a delegate with specific parameters.

While a request is pending, the project needs a workaround that stays within the rules, such as a less precise wrapping point, a validation at a later stage of the process, or a manual control. Prudence filed one request during the project, asking for a delegate in a receipt method where the line check would be cleaner, and Cobalt Ridge used the existing wrapper until Microsoft answered. Desmond warned against workarounds that duplicate standard logic, because they become a maintenance problem the moment the standard logic changes.

The update routine

Cobalt Ridge's routine for each service update followed a fixed pattern. When the update became available for early access, the developer environment was updated and CobaltRidgeCustom was rebuilt; compile errors and new obsolete warnings were fixed first. The automated tests, which included the receipt block, the waiver workflow and the certificate number sequence, were run. The update was then applied to the sandbox with the latest deployable package, the Regression Suite Automation Tool ran the recorded business process tests, and key users ran a short manual checklist. Only then was the update scheduled for production in a maintenance window. A list of methods the model wrapped, generated from the code, was compared to Microsoft's change notes so that any change to those methods got extra testing.

Who checks what during a service update.
StageWhoWhat is checked
Developer environmentDesmond and PrudenceBuild, warnings, unit tests
Sandbox (UAT)Annelise and key usersRegression Suite Automation Tool, manual checklist
Feature management reviewAnneliseNew and soon-mandatory features that affect the custom code
ProductionLifecycle Services scheduled updateSmoke test of receipts, waivers and reports after the window

Testing that protects the investment

Automated tests are what make updates routine. X++ supports unit tests through the SysTest framework: test classes extend SysTestCase and their methods assert expected results. Prudence wrote tests for the inspection rule, the certificate number reference and the RDP class's row counts. Business process tests recorded with Task recorder and run through the Regression Suite Automation Tool covered the end-to-end flows that users cared about. Desmond's rule was that any wrapper on a posting or validation method had to have a test that would fail if the wrapper stopped running, because those are the silent failures that cost the most.

Migrating older customizations

Projects that start from an older system, such as Dynamics AX 2012, bring overlayered customizations that must be rebuilt as extensions. Microsoft provides tooling and guidance for this, including analysis of the old code, and the code upgrade service in Lifecycle Services that converts code and reports what cannot be converted automatically. The usual outcome is that a large share of old modifications is no longer needed, because the standard product now does what they did or a configuration replaces them, and the rest is redesigned around extension points. Cobalt Ridge had no such legacy, but Desmond had done it twice and said the most valuable step was challenging each old customization's reason for existing before rewriting it.

Feature management and custom features

New functionality in service updates often arrives behind a switch in feature management, where administrators can read a description of each feature and turn it on when ready. Some features change the screens or logic that extensions depend on, so Cobalt Ridge reviewed new features that touched procurement, receiving and quality at each update and tested them in the sandbox before turning them on. Partners can also add their own features to feature management, so that a large extension can be shipped turned off and enabled per environment. Desmond considered it for the inspection feature but decided a parameter on the procurement parameters page was enough for a single customer.

Update scheduling

Customers choose when updates reach sandbox and production within Microsoft's release schedule, and they can pause a limited number of consecutive updates. Preview releases are available before general availability for customers who want to test early. Annelise put the update calendar into the project plan for the year after go-live, with a sandbox test week before each production update and a short freeze on new deployments during that week. The early access builds were applied only to the developer environment, so Desmond could find problems before the sandbox schedule began.

Keeping an inventory of extensions

Desmond kept an inventory of every wrapper, handler and copied artifact in CobaltRidgeCustom, generated from the code by a small script in the build pipeline. For each entry it listed the standard element and method, the reason, the tests that covered it and the owner. Before each update, the inventory was compared with the list of changed objects for the new version, and any match was tested first. The inventory also answered the auditors' question of how much of Microsoft's behavior the customer had changed, in one page.

Telemetry and support

Even with tests, some problems appear only in production. Finance and operations apps send telemetry that administrators and developers can use to investigate errors and slow operations, and Lifecycle Services provides environment monitoring with details of exceptions and long-running queries. When a support case is needed, Microsoft's support asks for the steps to reproduce, the activity identifiers from the error and the list of customizations involved. Cobalt Ridge's extension inventory answered the last question at once, which shortened one support case in the pilot from days to hours because it showed immediately that the problem was in standard code, not in an extension.

Desmond's final advice for the session was that upgrade readiness is a habit rather than a project. Teams that fix obsolete warnings as they appear, keep wrappers thin, write tests for every rule they enforce and read the release notes each time find service updates dull, which is exactly how they should be.

Worked problem

A wrapper that stopped working

After applying a service update to the sandbox, the Regression Suite Automation Tool test for blocked receipts fails: a receipt for a casting without a certificate posts successfully. The model compiled without errors. What happened and what should the team do?

Show solution
  1. Confirm the wrapper is not being called by setting a breakpoint in the developer environment updated to the same version.
  2. Compare the standard posting class between versions and find where the line check now happens.
  3. Move the thin wrapper to the new method, or to a delegate if Microsoft added one; the rule class does not change.
  4. Rerun the unit test and the regression test, and record the change in the release notes.

Answer: The standard code was restructured so the wrapped method is no longer on the posting path. Because the logic lived in a separate rule class and a test existed, the fix was small and was found before production.

Common mistakes

  • MistakeIgnoring obsolete warnings because the code still compiles.

    InsteadFix obsolete usages before they become errors in a later version.

  • MistakePutting business logic directly in wrappers.

    InsteadKeep wrappers thin and call your own classes, which are easy to move and test.

  • MistakeCopying standard code into an extension to change one line.

    InsteadFind an extension point or file an extensibility request; copies freeze old logic.

  • MistakeRelying on compile success to prove an update is safe.

    InsteadRun tests that would fail if wrappers stopped being called.

Summary and key terms

  • One Version means every customer moves forward through regular service updates, with limited ability to pause.
  • Updates cannot overwrite extensions but can break or silently bypass them when standard code changes.
  • SysObsolete warnings and the deprecated features list give early notice of removals.
  • Extensibility requests ask Microsoft for new extension points; workarounds should not duplicate standard logic.
  • Thin wrappers, automated tests and a fixed update routine make updates routine.
One Version
Microsoft's model of a single, continuously updated version of finance and operations apps.
Service update
A numbered release that customers apply on a regular cadence.
SysObsolete
An attribute that marks an element as obsolete and can produce warnings or errors.
Extensibility request
A request to Microsoft to add or open an extension point.
Regression Suite Automation Tool
A tool that runs recorded business process tests to find regressions.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why is a wrapper that compiles but is no longer called more dangerous than a compile error?

    Show answer

    It fails silently; only tests reveal that the rule is no longer enforced.

  2. What should an extensibility request include?

    Show answer

    The business scenario, the exact place in the code and the specific change wanted.

  3. Which Cobalt Ridge tests would catch the receipt block failing?

    Show answer

    The unit test for the receipt rule and the Regression Suite Automation Tool test for blocked receipts.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz