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;
}