Blob to BigText Missing something

derekj22
Member Posts: 16
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
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
Best Answer
-
Hi,
Use must use CALCFIELDS before you use CREATEINSTREAM.
Good luck.\\The truth exists in seven versions.5
Answers
-
Hi,
Use must use CALCFIELDS before you use CREATEINSTREAM.
Good luck.\\The truth exists in seven versions.5 -
Thank you @Peter+is1
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).aspx0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions