community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: How to copy values (Blob) ​​from one Codeunit “Temp Blob” to another Codeunit “Temp Blob”

Copying BLOB data from one Temp Blob codeunit to another requires creating an InStream from the source, an OutStream to the target, and using CopyStream to transfer the data. This technique became relevant after Microsoft deprecated Record TempBlob in BC15 and introduced the Temp Blob codeunit.

post Dynamics 365 Lab

Yun Zhu · 2025-10-29 · 296 words · about 1 min

"When you're writing code to manage the importing and exporting of files, you can use this codeunit."

Key points

  • Temp Blob codeunit replaced deprecated Record TempBlob starting in 2019 Release Wave 2 (BC15)
  • CreateInStream method reads data from the source BLOB with optional Encoding parameter
  • CreateOutStream method writes data to the target BLOB with optional Encoding parameter
  • Use CopyStream function to transfer data between InStream and OutStream objects

Quotes

  • “When you’re writing code to manage the importing and exporting of files, you can use this codeunit.” (Defines the primary use case for Temp Blob, helping developers understand when to apply this technique)

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.

No source states these links: they share an object, a model read them, or a person found the same subject.

Context

  • Features: Temp Blob codeunit, CreateInStream, CreateOutStream, CopyStream, BLOB data management, file import/export
  • Versions: BC15, 2019 Release Wave 2

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.