---
id: post/aardvarklabs-blog/2875
type: post
title: Managing Optional Extensions in Business Central AL Code
summary: This post explains how to create a single Business Central extension that optionally interacts with a third-party extension without creating a hard dependency. The technique uses NavApp.GetModuleInfo to detect if an optional extension is installed, then uses RecordRef and FieldRef to conditionally set extension-specific fields.
tier: community
language: en
tags:
  - optional extensions
  - dependencies
  - al code
  - recordref
  - fieldref
  - modular development
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:57:43.879Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 4fe8766193ab765232c046ec0c0339039f8d9de9939acf259d2226c317dbc34e
evidence:
  - kind: blog
    url: https://aardvarklabs.blog/2025/12/19/managing-optional-extensions-in-business-central-al-code/
    title: Managing Optional Extensions in Business Central AL Code
    date: "2025-12-19"
    commit: null
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/table/81
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "2875"
source_id: aardvarklabs-blog
source_name: Aardvark Labs
url: https://aardvarklabs.blog/2025/12/19/managing-optional-extensions-in-business-central-al-code/
published_at: "2025-12-19T13:00:00.000Z"
author: Marcel Chabot
full_text: false
words: 478
quotes: []
code_objects_mentioned:
  - table Gen. Journal Line
  - table TMG_EntityCashTransfer
systems:
  - development
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://aardvarklabs.blog/2025/12/19/managing-optional-extensions-in-business-central-al-code/embed/
  image: https://aardvarklabs.blog/wp-content/uploads/2025/12/lab-notes.png
  image_alt: null
  image_w: 1024
  image_h: 1024
  site_name: Aardvark Labs
  favicon: https://aardvarklabs.blog/wp-content/uploads/2024/04/design-1.png?w=32
  probed_at: "2026-10-07T11:51:13.346Z"
---

# Managing Optional Extensions in Business Central AL Code

[Read the post](https://aardvarklabs.blog/2025/12/19/managing-optional-extensions-in-business-central-al-code/) · Aardvark Labs (Marcel Chabot) · 2025-12-19 · 478 words · tier community · reviewed (checked by Opus)

> This post explains how to create a single Business Central extension that optionally interacts with a third-party extension without creating a hard dependency. The technique uses NavApp.GetModuleInfo to detect if an optional extension is installed, then uses RecordRef and FieldRef to conditionally set extension-specific fields.

## Key points

- Call NavApp.GetModuleInfo with the optional extension's app ID to find out at runtime whether it is installed
- Split the journal creation into a core insert and a separate step for the fields from the optional extension
- Use RecordRef and FieldRef with field numbers taken from page inspection to set those fields without a dependency
- Check that each FieldRef is active before giving it a value, then modify the record through the RecordRef
- With no dependency declared in app.json, one app runs on systems with or without the third-party extension

## 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.

- [table 81 "Gen. Journal Line"](../../objects/table/81.md)
- table "TMG_EntityCashTransfer"

Not found in BC28-30: table "TMG_EntityCashTransfer".

## Context

- Features: optional extension detection, runtime field mapping, conditional field updates, extension GUID checking, module info retrieval

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