community postIntegration & APIscommunity - not Microsoftreviewed - checked by Opus

Another Look at App Integration in Business Central – Part 2

This post demonstrates how to integrate two independent Business Central apps without creating a direct dependency between them by using interfaces and a shared app integration layer. The approach allows apps to register and discover each other's functionality at runtime using enums, dictionaries, and version management.

post James Pearson

James Pearson · 2025-05-07 · 1,459 words · about 7 min

"The challenge that we are trying to solve is to allow Business Central apps to call each other's functionality without creating a dependency."

Key points

  • Apps can integrate without direct dependencies by implementing interfaces defined in a shared app integration layer
  • An App Integration codeunit uses a dictionary to store and manage implementations of interfaces from different apps
  • Version numbers in interface names enable future contract changes while preventing breaking changes
  • Consuming apps check for interface implementation before calling external app functionality, with fallback logic if unavailable
  • The pattern separates concerns with each app owning specific responsibilities through single responsibility principle

Quotes

  • “The challenge that we are trying to solve is to allow Business Central apps to call each other’s functionality without creating a dependency.” (This defines the core problem the solution addresses - enabling optional app integration without tight coupling)
  • “Each app should have a clear set of responsibilities which does not overlap with the responsibilities of another app.” (Explains the architectural principle driving the design - separation of concerns ensures maintainability and independent deployment)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • interface “IShippingAgentIntegration1.0”
  • interface “IApp”
  • enum “App”
  • codeunit “App Integration”
  • codeunit “Shipping Agent Integration”
  • codeunit “Calc. Shipping Charges”

Not found in BC28-30: interface “IShippingAgentIntegration1.0”, interface “IApp”, enum “App”, codeunit “App Integration”, codeunit “Shipping Agent Integration”, codeunit “Calc. Shipping Charges”.

Context

  • Features: Interface-based app integration, Runtime implementation registration, Version management for interfaces, Dictionary-based implementation storage, Implementation discovery and casting, Event-based initialization, Fallback logic for missing implementations

Source: James Pearson, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.