Announcements
No record found.
tableextension 50100 "YourTableExt" extends "Your Base Table" { fields { field(50100; "Your Blob Field"; Blob) { Caption = 'Your Blob Field'; } } }
codeunit 50100 "Blob Handler" { procedure BlobToText(BlobField: Blob) ReturnValue: Text var InStream: InStream; Line: Text; begin if BlobField.HasValue() then begin BlobField.CreateInStream(InStream, TEXTENCODING::UTF8); InStream.ReadText(ReturnValue); end; end; procedure TextToBlob(var BlobField: Blob; TextValue: Text) var OutStream: OutStream; begin Clear(BlobField); BlobField.CreateOutStream(OutStream, TEXTENCODING::UTF8); OutStream.WriteText(TextValue); end; }
page 50100 "Your API Page" { APIVersion = 'v2.0'; APIPublisher = 'yourPublisher'; APIGroup = 'yourGroup'; EntityName = 'yourEntity'; EntitySetName = 'yourEntities'; PageType = API; SourceTable = "Your Base Table"; layout { area(Content) { field(blobContent; GetBlobContent()) { Caption = 'Blob Content'; ApplicationArea = All; } // ... other fields } } var BlobHandler: Codeunit "Blob Handler"; local procedure GetBlobContent(): Text begin exit(BlobHandler.BlobToText(Rec."Your Blob Field")); end; // If you need to handle incoming data trigger OnInsertRecord(BelowxRec: Boolean): Boolean begin BlobHandler.TextToBlob(Rec."Your Blob Field", blobContent); end; }
Key Points to Remember:
Hi, good day I hope this can help you, and give you some hints.
Dynamics 365 Business Central: handling BLOB fields on APIs – Stefano Demiliani
Best Regards Gerardo
Hi, I tried all different suggested solutions. When I export the Blob multiline content, I almost always get ASCII char such as \u0003 or \u0016 or \n or \u001e.
I tried using encode UTF8, UTF16, WindowsText, MSDOS. Same result.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 1,993 Super User 2026 Season 1
YUN ZHU 1,116 Super User 2026 Season 1
Khushbu Rajvi. 557 Super User 2026 Season 1