On Page 5906 (Service Item Worksheet), I have added a variable "RemarksLongText". This variable is the one that a user will ad text to on the page. I have added a Field to the Service Header Table called Remarks as type blob.
I have the following code that works:
Remarks - OnValidate()
IF RemarksLongText.LENGTH > 0 THEN
MESSAGE('Should Save');
ServHeader.Remarks.CREATEOUTSTREAM(Ostream);
RemarksLongText.WRITE(Ostream);
ServHeader.MODIFY;
IF ServHeader.Remarks.HASVALUE THEN
BEGIN
ServHeader.Remarks.CREATEINSTREAM(Istream);
RemarksLongText.READ(Istream);
MESSAGE('Should have read %1', RemarksLongText.LENGTH);
END;
If I use the code below in the AfterGetRecord(), AfterGetCurrentRecord(), or OnOpenPage() I get RemarksLongText.LENGTH is equal to 0.
IF ServHeader.Remarks.HASVALUE THEN
BEGIN
ServHeader.Remarks.CREATEINSTREAM(Istream);
RemarksLongText.READ(Istream);
MESSAGE('Should have read %1', RemarksLongText.LENGTH);
END;
I have proved that the OutStream InStream works in the validate and that the data is in the database.
What I am wanting to know is what am I missing that I cannot get my variable to Read the Instream
0
Answers
Use must use CALCFIELDS before you use CREATEINSTREAM.
Good luck.
I ended up finding this which helped me get to where I needed to be.
https://msdn.microsoft.com/en-us/library/dd301120(v=nav.90).aspx