Tip of the Week #187 – TempBLOB

Tip of the Week #187 – TempBLOB

Developer Rikard Hult brings us this week’s tech tip.

The table TempBLOB has some great functions that could be used to store and read data into BLOB fields. And it’s easy to use!

Forget instream and outstream and other complex methods.

Step 1. Create a table with a BLOB field or add a BLOB to an existing table.

Create two functions, LoadTxt and SaveTxt, on the table. Both functions have one local variable, and TempBlob of type record TempBlob, should be temporary.

The LoadTxt should have text as a return value. The SaveTxt should have InTxt as a parameter.

Step 2. Create the page or add it to the existing page

Add one field and set SourceExpr to a newly-created global text variable.

Step 3 is to call the functions, the LoadTxt on OnAfterGetRecord and the SaveTxt on validate on the new field.

That’s all. 

This method could be used on reports and xmlports as well.

And it’s also possible to use the same code in AL.

Thank you Rikard!

Call Now Button