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
"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.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Attachment capabilities and limitations (preview) — possibly related: names Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs) — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs) — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox) — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs) — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: previewing PDF files in web client using the new ExtendedDataType = Document. — possibly related: both name Codeunit 4100 “Temp Blob”
- Step by Step Guide to Importing Excel Data into Business Central — possibly related: both name Codeunit 4100 “Temp Blob”
- Using streams in Business Central — possibly related: names Codeunit 4100 “Temp Blob”
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.