Blob to Stream to Text Issue

Hello,

When testing the following code for the first time, it successfully worked, but after a few attempts it began to give only empty blank messages.
Could anyone tell me what could be the issue? Thank you.

//minutes changed to hours for testing purposes
FiveMinAgo := CURRENTDATETIME - (5 * 60 * 60 * 1000);

RecordLink.RESET();
RecordLink.SETRANGE(Created,FiveMinAgo,CURRENTDATETIME);

IF RecordLink.FINDFIRST() THEN
  REPEAT
    RecordLink.Note.CREATEINSTREAM(NoteStream);
    NoteStream.READTEXT(NoteText);
    MESSAGE(NoteText);
  UNTIL RecordLink.NEXT() = 0;

Best Answers

  • vaprogvaprog Member Posts: 1,144
    Answer ✓
    You need to call CALCFIELDS on the blob field before CREATEINSTREAM.

    But I suggest you use ReadRecordLinkNote in Codeunit 10 Type Helper instead of reinventing the wheel.
  • robertsstrrobertsstr Member Posts: 4
    Answer ✓
    vaprog wrote: »
    You need to call CALCFIELDS on the blob field before CREATEINSTREAM.

    But I suggest you use ReadRecordLinkNote in Codeunit 10 Type Helper instead of reinventing the wheel.

    Thank you my friend

Answers

  • vaprogvaprog Member Posts: 1,144
    Answer ✓
    You need to call CALCFIELDS on the blob field before CREATEINSTREAM.

    But I suggest you use ReadRecordLinkNote in Codeunit 10 Type Helper instead of reinventing the wheel.
  • robertsstrrobertsstr Member Posts: 4
    Answer ✓
    vaprog wrote: »
    You need to call CALCFIELDS on the blob field before CREATEINSTREAM.

    But I suggest you use ReadRecordLinkNote in Codeunit 10 Type Helper instead of reinventing the wheel.

    Thank you my friend
Sign In or Register to comment.