Hello, I am using the GetNote procedure below to add Notes to a report in Business Central.
The notes are getting printed on the report, but it is adding a special character at the beginning.
The actual Note does not contain any special character at the beginning. Can someone please suggest how to remove this special character on the report?
Any help will be greatly appreciated. Thank you!
procedure GetNote(RecRef: RecordRef): Text[250]
var
RecordLink: Record "Record Link";
NoteText: BigText;
InStr: InStream;
begin
Clear(Notes);
RecordLink.SetRange("Record ID", RecRef.RecordId);
RecordLink.SetRange(Type, RecordLink.Type::Note);
if RecordLink.FindSet then
repeat
RecordLink.CalcFields(Note);
if RecordLink.Note.HasValue() then begin
Clear(NoteText);
RecordLink.Note.CreateInStream(InStr);
NoteText.Read(InStr);
NoteText.GetSubText(NoteText, 2)
end;
until RecordLink.Next() = 0;
Notes := CopyStr(Format(NoteText), 1, 250);
end;