Skip to main content

New in Utility Module - Targeted Library Overrides

· 2 min read
Lukas Werner
Senior Developer @ ADITO xRM

With version 4.1.0 of the utility module, there is a new option that allows developers to override functions from external module libraries more selectively.


Overview

The old way

  • Until now, if you needed to override libraries from external modules, the only option was to override the entire library using the “Override Process” in the Designer.
  • This approach had a major downside: all functions were overridden, and after a module update, new changes are not applied.

The new solution

  • Starting with xRM version 2026.4.0, all modules support the new utilityLibraryOverride_service of the utility module.
  • This allows developers to override only specific functions within a library instead of replacing the entire library.

Example

Suppose the function DocumentUtil.downloadSelectedDocuments() contains a bug that needs to be fixed quickly within your own project. With the new approach, you can create a new implementation under the utilityLibraryOverride_service.

Screenshot

The implementation contains the following process:

let overrides = (pGlobalThis) => {
return {
DocumentUtil: {
downloadSelectedDocuments: (/* pParam1, pParam2, ... */) =>
{
pGlobalThis.logging.log("downloadSelectedDocuments overridden!");
// new logic
}
}
};
};

// @ts-expect-error
return overrides;

Of course, you should still create a ticket for xRM so that the fix can be incorporated into the standard version as soon as possible.

Important:

  • This way of overriding functions has its own limitations. It is not possible to import libraries which include LibraryOverrideManager_lib in a direct or indirect way. This causes cyclic imports which prevents overrides from beeing applied.
  • To use existing imports use the provided pGlobalThis parameter.
  • Also note that even after an update the overridden function stays overridden. New changes are only applied if you delete the service implementation. In the future, this solution may be replaced by an even better method.

Prerequisites

Before using the new override option, make sure the following prerequisites are met:

  • Utility module version 4.1.0 or later is installed.
  • The library you want to override uses the new LibraryOverrideManager_lib.

Why this matters

  • Solves the pain of needing to override entire libraries.
  • Provides a centralized location for this type of override.