Hi all,
Version: NAV2009 R2.
Issue: Export "Blob Reference" to Text File from a new table "Object Version".
I've started working in a project where a new Table "Object Version" is used to Store a Backup/Version from the changed objects.
The table is similar to Table "Object" but with a new field "Version No.", this field is also in the primary key.
Currently when there is a need to Export an Older version we've to Modify the Table Object to "restore" the previous version, and Use the EXPORTOBJECTS function.
This is not working 100%, per example if we Export a Report that list Table 50000, the fields listed in the Report will be from the current version of the Table 50000 and not at the time of the Backup.
Example how is done currently:
ObjectVersion.GET(....);
ObjectVersion.CALCFIELDS("Blob Reference")
ObjectVersion."Blob Reference".EXPORT(FileName).
Object.GET(.....);
Object."Blob Reference" := ObjectVersion."Blob Reference";
Object.MODIFY;
EXPORTOBJECTS(FileName,Object,0);
//Then restore the Object."Blob Reference"
This is working, but not 100% correct in some cases.
I want to do something similar but whithout using the table Object.
1.
ObjectVersion.GET(....);
ObjectVersion.CALCFIELDS("Blob Reference")
ObjectVersion."Blob Reference".EXPORT(FileName).
No Success in this, this will not export in Text Format.
2.
ObjectVersion.GET(....);
ObjectVersion.CALCFIELDS("Blob Reference")
ObjectVersion."Blob Reference".CREATEINSTREAM(InStr);
File.CREATE(FileName);
File.WRITEMODE(TRUE);
File.TEXTMODE(TRUE);
FILE.CREATEOUTSTREAM(OutStr);
COPYSTREAM(OutStr,InStr);
FILE.CLOSE
No Success in this, this will not export in Text Format.
I see there are some tools to "read" the documentation
http://www.mibuso.com/dlinfo.asp?FileID=1544
Is there any other tool/way to read/Export in Text file?
Many thanks in advance for your help!
Comments
But In this case the versions/backups are done via SQL with a copy of the current record of table Object.
I also have a "second" issue as there are objects stored like this from other databases, like one main database with Backup/Versions of the other DB.
the Perfect solution would be to be able to export directly from the Blob Reference to Text
In the past I used simple application to track NAV Applications in the Windows App Pool and then to pull out and back up txt versions of the files when needed. This did not require sophisticated objects in the DEV database. However this solution was using old Dev Tools entrance points, which has been closed now.
Best Regards,
Tiago