---
id: post/nataliekarolak-com/3910
type: post
title: DataTransfer type causing runtime errors
summary: "The DataTransfer type speeds up AL upgrade code, but two cases fail at runtime with no compiler warning: AddConstantValue with literal values on Code fields, later fixed in platform builds 27.0.44405 and 26.0.44406, and AddSourceFilter on FlowFields, FlowFilters or Media fields. The workaround for the first is a Code variable; for the second, write the upgrade without DataTransfer using SetRange and ModifyAll."
tier: community
language: en
tags:
  - datatransfer
  - upgrade code
  - runtime errors
  - code fields
  - flowfields
  - media fields
  - workarounds
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-25T18:23:14.357Z"
  flags: []
generated:
  at: "2026-10-25T18:17:26.277Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: c20839a90d7fbca5fba37c25d46acefd9964302a53916000a913d742cc94fc76
evidence:
  - kind: blog
    url: https://nataliekarolak.wordpress.com/2026/01/09/datatransfer-type-causing-runtime-errors/
    title: DataTransfer type causing runtime errors
    date: "2026-01-09"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://nataliekarolak.wordpress.com/2026/01/09/datatransfer-type-causing-runtime-errors/
    title: DataTransfer type causing runtime errors
    date: "2026-01-09"
    commit: null
    t: null
    quote: The DataTransfer data type is great for improving AL upgrade code performance.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "3910"
source_id: nataliekarolak-com
source_name: The BC Docs Librarian
url: https://nataliekarolak.wordpress.com/2026/01/09/datatransfer-type-causing-runtime-errors/
published_at: "2026-01-09T10:42:25.000Z"
author: Natalie Karolak
full_text: false
words: 237
quotes:
  - text: The DataTransfer data type is great for improving AL upgrade code performance.
    why_it_matters: Establishes the value of DataTransfer while introducing the undocumented limitations that follow
code_objects_mentioned: []
systems:
  - development
  - platform
versions_mentioned:
  - 27.0.44405
  - 26.0.44406
cautions:
  - kind: gotcha
    quote: When assigning a constant value to a Code field, then don't write your code as follows
    objects:
      - type: other
        name: DataTransfer
    events: []
    versions: []
  - kind: gotcha
    quote: Do not filter on FlowFields, FlowFilters, or fields of the Media data type
    objects:
      - type: other
        name: DataTransfer
    events: []
    versions: []
preview:
  embeddable: true
  frame_url: https://nataliekarolak.wordpress.com/2026/01/09/datatransfer-type-causing-runtime-errors/embed/
  image: https://nataliekarolak.wordpress.com/wp-content/uploads/2022/11/cropped-logo-216x216-1.png?w=200
  image_alt: null
  image_w: 200
  image_h: 200
  site_name: The BC Docs Librarian
  favicon: https://nataliekarolak.wordpress.com/wp-content/uploads/2022/11/cropped-logo-216x216-1.png?w=32
  probed_at: "2026-10-25T18:21:54.642Z"
---

# DataTransfer type causing runtime errors

[Read the post](https://nataliekarolak.wordpress.com/2026/01/09/datatransfer-type-causing-runtime-errors/) · The BC Docs Librarian (Natalie Karolak, MVP) · 2026-01-09 · 237 words · tier community · reviewed (checked by Opus)

> The DataTransfer type speeds up AL upgrade code, but two cases fail at runtime with no compiler warning: AddConstantValue with literal values on Code fields, later fixed in platform builds 27.0.44405 and 26.0.44406, and AddSourceFilter on FlowFields, FlowFilters or Media fields. The workaround for the first is a Code variable; for the second, write the upgrade without DataTransfer using SetRange and ModifyAll.

## Key points

- DataTransfer.AddConstantValue fails when assigning constants directly to Code fields; use a Code variable instead as a workaround
- DataTransfer.AddSourceFilter does not support FlowFields, FlowFilters, or Media type fields; fall back to traditional SetRange and ModifyAll methods
- These issues may be fixed in future platform builds; the first issue was resolved in platform 27.0.44405 and 26.0.44406
- AL compiler does not warn about these problems before runtime execution

## Quotes

- "The DataTransfer data type is great for improving AL upgrade code performance." (Establishes the value of DataTransfer while introducing the undocumented limitations that follow)

## Heads up

- gotcha: "When assigning a constant value to a Code field, then don't write your code as follows" (about other DataTransfer)
- gotcha: "Do not filter on FlowFields, FlowFilters, or fields of the Media data type" (about other DataTransfer)

## Context

- Features: DataTransfer type, AddConstantValue method, AddSourceFilter method
- Versions: 27.0.44405, 26.0.44406

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