Automation, Streams, and Navision
Matt_Keyes
Member Posts: 23
Hey all,
i need to write a decent amount of text out of an automation variable i have created. My thought is to store this in a Navision BLOB field. However, i can't seem to get it to work quite right. Does anyone know of any tutorials or examples for something like this?
Many thanks!
i need to write a decent amount of text out of an automation variable i have created. My thought is to store this in a Navision BLOB field. However, i can't seem to get it to work quite right. Does anyone know of any tutorials or examples for something like this?
Many thanks!
0
Comments
-
search the forum for "blob" it will probably help alot.0
-
I had a similar problem, but i solved it by creating a new temporary text file and passing the path to automation server. This is the easiest way to implement.
More advanced way would be using streams. I haven't done much with that, but you can check some XMLPorts in Navision which exports for blobs of tables to XML files (e.g. Product list export including photos). I have seen that navision uses special automation server in order to convert blob data to hexadecimal symbols. This seems the similar to what you want to do.
Furthermore, take a look at new data type BIGTEXT
0 -
That is a good tip. There are some standard Navision XMLPorts that use the TempBLOB table, in order to be able to access streams. If you do a where used on the Std XMLPorts, you will find the codeunits that use them, and examples of how to use that. I don't have access to Navision right now, but if you need to I will see if I can find an example later this week.0
-
Here is code on how to use BLOB and store text in it. Hope it helps
In this case body is a blob in customer table
EmailOutstream is OutStreamCustomer.get('10000'); Customer.Body.CREATEOUTSTREAM(EmailOutStream); Ch10 := 10; CH13 := 13; CH := FORMAT(CH13) + FORMAT(Ch10); Text := ' ***** ' + Title + ' *****'+CH; EmailOutStream.WRITETEXT(Text,MAXSTRLEN(Text)); Text := ' ***** ' + Another line + ' *****'+CH; EmailOutStream.WRITETEXT(Text,MAXSTRLEN(Text)); Customer.Modify;
To read the data. here is an example on how to do it. I'm basically writing it to a file and opening the file.MyFile.WRITEMODE(TRUE); MyFile.CREATE(ENVIRON('temp') + 'temp.txt'); MyFile.OPEN(ENVIRON('temp') + 'temp.txt'); MyFile.TEXTMODE(TRUE); Customer.get('10000'); WITH Customer DO BEGIN CALCFIELDS(Body); IF Body.HASVALUE THEN BEGIN Body.CREATEINSTREAM(EmailInStream); WHILE NOT (EmailInStream.EOS()) DO BEGIN Int := EmailInStream.READTEXT(Txt,MAXSTRLEN(Txt)); MyFile.WRITE(Txt); END; END; MyFile.CLOSE; HYPERLINK(ENVIRON('temp') + 'temp.txt'); END:0 -
Thanks y'all for the help!
i had searched for BLOBs on the forums, but hadn't found anything specific. However, i'll try the above... i didn't think of using a file, but if it comes to that i guess that would work
Thanks again.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

