web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Blob field not displaying on page

(0) ShareShare
ReportReport
Posted on by 891

I've created a table and a page in a BC extension. One of the fields in the table is of type: BLOB. It is not displaying on the page. I've tried to replicate what happens with the 'Work Description' BLOB field in the Sales Header table / Sales Invoice page. Where am I going wrong? See my code below. Thanks in advance for help.

table 50050 LogSheets
{

fields
{
// Various fields...

field(9; DescriptionOfTasksPerformed; BLOB)
{
Caption = 'DescriptionOfTasksPerformed';
}
}

var
ReadingDataSkippedMsg: Label 'Loading field %1 will be skipped because there was an error when reading the data.\To fix the current data, contact your administrator.\Alternatively, you can overwrite the current data by entering data in the field.', Comment = '%1=field caption';

// Cribbed from Sales Header (table & page) - WorkDescription
procedure GetTasksDescription() TasksDescription: Text
var
TypeHelper: Codeunit "Type Helper";
InStream: InStream;
begin
CalcFields(DescriptionOfTasksPerformed);
DescriptionOfTasksPerformed.CreateInStream(InStream, TEXTENCODING::UTF8);
if not TypeHelper.TryReadAsTextWithSeparator(InStream, TypeHelper.LFSeparator(), TasksDescription) then
Message(ReadingDataSkippedMsg, FieldCaption(DescriptionOfTasksPerformed));
end;

procedure SetTasksDescription(NewTasksDescription: Text)
var
OutStream: OutStream;
begin
Clear(DescriptionOfTasksPerformed);
DescriptionOfTasksPerformed.CreateOutStream(OutStream, TEXTENCODING::UTF8);
OutStream.WriteText(NewTasksDescription);
Modify;
end;

}

// ---------------------------------------------------

page 50051 LogSheetCard
{
Caption = 'Log Sheet';
PageType = Document;
RefreshOnActivate = true;
SourceTable = LogSheets;

layout
{
area(Content)
{
group("LogSheetDetails")
{
// Various fields...
}
group("Tasks")
{
Caption = 'Description of tasks performed';
field("DescriptionOfTasksPerformed"; Rec.DescriptionOfTasksPerformed)
{
ApplicationArea = Basic, Suite;
Importance = Additional;
MultiLine = true;
ShowCaption = false;
ToolTip = 'Description of tasks performed';
Editable = true;

trigger OnValidate()
begin
Rec.SetTasksDescription(TasksDescription);
end;
}
}
}
}
var
TasksDescription: Text;

trigger OnAfterGetRecord()
begin
TasksDescription := Rec.GetTasksDescription;
end;
}

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    On the page you want to display the blob field you need to to a calcfields( DescriptionOfTasksPerformed) for it to show if the content of the blob filed can be displayed in bc.

  • Nick Webb Profile Picture
    891 on at

    Thanks for your prompt response.

    At the bottom of the posted code there's the line: trigger OnAfterGetRecord. This in turn calls GetTasksDescription, which in turn calls CalcFields(DescriptionOfTasksPerformed);

    ... and yet still no box is displayed on the page under 'Description of tasks performed' (see below)?

    I've confirmed that these lines of code are being called by putting Message lines in the relevant procedures. It's a puzzle.

    anydesk00138.png

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans