X++ Extensions on Sales Order Posting: Living With Customer Extensions After Service Updates

Why Chain of Command extensions on posting collide, what to do when a method becomes internal, why custom warehouse mobile flows break, and the regression routine to run before each update.

Sales order posting breaks after a service update because several extensions wrap the same posting classes with Chain of Command, and the order in which those wrappers run is not guaranteed, so code that relied on another extension running first fails although its own code is unchanged. An update can also make a wrapped method internal or non-wrappable, which stops the model compiling. Reduce conflicts with narrow extension points, events and delegates instead of wrapping where Microsoft provides them, and no assumptions about state another extension set. Then run a regression routine on every update: compile against the preview, run the posting and warehouse mobile tests, and fix before production updates. Solzet builds and refactors X++ extensions for product vendors.

Why do several extensions on the same posting class conflict after an update?

Sales order posting runs through a small set of classes, such as the sales form letter classes and the invoice journal create and post classes, and almost every product that touches sales wants to add something there: a tax add-on, an EDI module, a rebate engine, the customer's own fields. Each one wraps the same methods with Chain of Command. Every wrapper calls next, and the platform builds the chain at runtime. Microsoft documents that the order in which several wrappers of the same method run is not guaranteed, and in practice it can change when the models, the build or the update change.

So two extensions that worked side by side for a year can fail after an update that did not touch either of them. The rebate extension reads a field that the tax extension used to set before it, and now sets after it. One wrapper commits or throws in the middle of posting and leaves the other in a state it never expected. A wrapper skips its own logic when a flag is set, and the flag now comes from somewhere else. The symptom is a posting error or a wrong amount; the cause is an assumption about order.

  • Two wrappers depend on each other running in a particular order.
  • A wrapper reads a buffer or a class member that another wrapper modifies.
  • A wrapper catches and swallows an exception that another wrapper needs to see.
  • A wrapper changes the transaction scope, for example by committing or opening a nested transaction around posting.
  • Standard code that a wrapper copied or worked around has changed underneath it.

What design rules keep Chain of Command extensions on posting from colliding?

Most conflicts are designed in, so they can be designed out. The rules below are the ones we apply when we build or refactor extensions on posting, and the ones we check first in an existing model.

RuleWhy it reduces conflicts
Wrap the narrowest method that does the jobWrapping a run or main method of posting puts your code around everything every other extension does; a small method has fewer neighbours.
Use events and delegates where Microsoft provides themData events and published delegates are designed for several subscribers and say what state is available when they fire.
Make no assumptions about state another extension setsRead what you need from the database or the buffer at the time you need it, and do not depend on fields being set earlier in the chain.
Always call next, and only onceSkipping or duplicating next breaks every other wrapper in the chain; only methods marked as replaceable may skip it, and then with great care.
Keep logic out of the wrapperThe wrapper calls a separate class that holds the logic, so it can be tested on its own and moved to a different extension point when needed.
Never change the transaction scope inside postingNo commits, no catch blocks that hide errors from the standard code, no long-running calls to external services in the posting transaction.
Give every behaviour a switchA parameter or feature flag that turns the extension logic off lets you isolate a conflict in production without a deployment.

What do you do when an update makes a wrapped method internal or non-wrappable?

Only public and protected methods can be wrapped. If Microsoft makes a method internal, marks it as not wrappable or not hookable, or removes it, every extension that wrapped it stops compiling against the new version. That is a deliberate signal, not a bug: Microsoft is closing an extension point it does not want to support, often because a better one exists.

The response has three steps. First, find the alternative: the caller of the method may be public, a delegate or data event may fire at the same point, or the logic may belong on a different class in the flow. Check the release notes and the current Microsoft Learn documentation for your version, because Microsoft often names the replacement. Second, if no alternative exists, log an extensibility request with Microsoft through the channel Microsoft Learn describes, with the business scenario and the exact method, and plan an interim design that does not need the closed point. Third, refactor the extension to the new point and add a test that fails if the behaviour changes, so the next change is caught at compile or test time instead of in production.

Why do custom Warehouse Management mobile app flows break after a service update?

Custom mobile flows sit on the classes that drive the Warehouse Management mobile app. Older customisations extend the work execution display classes, which build each screen and handle each step; newer standard flows are built on the process guide framework, which splits a flow into steps and controllers. When Microsoft moves a standard flow to the process guide framework, changes the steps of a flow or changes the controls on a screen, a customisation that wrapped the old classes can stop being called, call a step that no longer exists, or show a screen the app no longer expects.

Treat custom mobile flows as their own test set. Keep a list of every flow you have changed or added, with the class and the extension point, and test each one on a device or the app against the preview update, not only in a browser. Where a flow you customised has moved to the process guide framework, plan to rebuild the customisation on the new framework rather than keeping it alive on the old one. The details of both frameworks change between versions, so check the current Microsoft Learn documentation for warehouse mobile app development for your version before you design.

  • An inventory of custom and changed flows: menu item, flow, class and extension point.
  • A scripted test per flow with real items, locations, licence plates and labels.
  • Tests run on a device or the mobile app against the preview update, including what happens when a scan fails.
  • A rebuild plan for customisations on flows that Microsoft has moved to the process guide framework.

What regression routine should run before every service update reaches production?

Make the update a routine with dates, not an event. Microsoft publishes service updates in advance and lets you apply them to a sandbox environment before production, and the routine uses that window every time.

  • Compile every model against the preview version in the build pipeline, and treat new errors and best practice warnings on your extensions as work items.
  • Deploy to a sandbox on the preview version with production-like data.
  • Run the posting reference set: sales orders with each pricing, tax, discount and charge combination you sell, posted from confirmation to invoice by an ordinary user.
  • Run automated test plans with the Regression Suite Automation Tool and the unit tests in your models.
  • Run the warehouse mobile test set on a device or the app.
  • Fix, rebuild and redeploy to the sandbox, and only then let the update reach production on its scheduled date.

How should a product vendor keep its extensions compatible with customer extensions?

A vendor's product will share posting with customer extensions and other vendors' products it has never seen, so it has to be the well-behaved neighbour. Publish your own extension points, such as delegates on your classes, so customers extend your product instead of wrapping it. Document every standard method you wrap, so a customer or another vendor can see the overlap. Test your release against the preview of each service update before your customers receive it, and against the common combinations your customers run.

How an upgrade programme adds X++ capacity and organises regression testing across rehearsals is covered on X++ capacity for Finance and Operations upgrade programmes. If you also ship a Business Central app, the same problem with AL event subscribers is on Business Central extension conflicts after updates.

What does Solzet do for vendors and customers with conflicting X++ extensions?

Solzet builds and refactors X++ extensions for product vendors and for customers running several products on the same posting flow. We reproduce the conflict on the preview version, identify which wrappers collide and why, refactor them to narrower extension points or events, write the extensibility requests where no point exists, and set up the build pipeline, the posting reference set, the automated test plans and the mobile test set so each service update is checked the same way. Our own senior X++ developers and consultants do the work. The service line is on Dynamics 365 Finance and Operations implementation.

For the CRM side of a product, buyers who would rather not carry Microsoft licensing can choose a custom CRM. We recommend the right solution: Dynamics 365 (Customer Engagement, Business Central or Finance and Operations), Power Platform, or a custom-built CRM. One team for CRM, ERP and the integration between them.

What do people ask us?

Why does sales order posting fail after a Finance and Operations service update when we changed nothing?

Usually because several extensions wrap the same posting methods with Chain of Command and one of them depended on running in a particular order. The order of several wrappers is not guaranteed, so an update that changes the build can change it. Reproduce on the preview version, find the wrappers on the failing method and remove the order dependency.

In what order do multiple Chain of Command extensions run?

Microsoft does not guarantee the order in which several wrappers of the same method run. Design every wrapper so it works whether it runs first, last or in between, and read the state it needs at the time it needs it.

Microsoft made a method internal and our X++ extension no longer compiles. What now?

Only public and protected methods can be wrapped. Look for the alternative extension point, such as a public caller, a delegate or a data event, and check the release notes for a named replacement. If none exists, log an extensibility request with Microsoft and refactor to an interim design.

Should we use events or Chain of Command on posting?

Use events and delegates where Microsoft provides them at the point you need, because they are designed for several subscribers. Use Chain of Command on the narrowest method that does the job when no event exists, always call next, and keep the logic in a separate class.

Why did our custom Warehouse Management mobile app flow stop working after an update?

Custom flows extend the classes that drive the mobile app. When Microsoft changes a standard flow, its steps or its screens, or moves it to the process guide framework, a customisation on the old classes can stop being called. Test every custom flow on a device against the preview update and plan rebuilds on the new framework.

How do we test X++ extensions before a service update reaches production?

Compile all models against the preview version, deploy to a sandbox on that version, run the posting reference set and automated test plans with the Regression Suite Automation Tool, test custom warehouse mobile flows on a device, and fix before the scheduled production update.

Does Solzet refactor X++ extensions for product vendors?

Yes. Solzet builds and refactors X++ extensions for product vendors and customers, moves them to narrower extension points or events, writes extensibility requests where needed and sets up the regression routine for each service update, with its own developers.

Which solution is right for your business?

Tell us what you need. A senior consultant replies within one business day with a recommendation (Customer Engagement, Business Central, Finance and Operations, Power Platform or a custom-built CRM), not a sales script.