I Try to add all the blobreferences in Table "Objects" into a file. However the Copystream command causes MBS NAV (5.1) to crash. any ideas?
FilePath := 'C:\QQQ\CCChecksum.BIN';
DestinationFile.WRITEMODE(TRUE);
DestinationFile.TEXTMODE(FALSE);
DestinationFile.CREATE(FilePath);
DestinationFile.CREATEOUTSTREAM(Outstr);
ObjectTable."BLOB Reference".CREATEINSTREAM(Instr);
ObjectTable.RESET;
ObjectTable.SETFILTER(Type,
'%1|%2|%3|%4|%5|%6|%7',
ObjectTable.Type::Table,
ObjectTable.Type::Form,
ObjectTable.Type::Report,
ObjectTable.Type::Dataport,
ObjectTable.Type::Codeunit,
ObjectTable.Type::XMLport,
ObjectTable.Type::MenuSuite
);
ObjectTable.FINDSET;
REPEAT
ObjectTable.CALCFIELDS(ObjectTable."BLOB Reference");
IF ObjectTable."BLOB Reference".HASVALUE THEN BEGIN
IF NOT COPYSTREAM(Outstr,Instr) THEN
ERROR('COPYSTREAM failed');
END;
UNTIL ObjectTable.NEXT = 0;
0
Comments
if object.findset then repeat
object.calcfields(Blob reference");
object.export('c:\object.file',false);
until object.next = 0;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Are there in the file only the BLOB reference or some more?
If the BLOB Ref. is only in the file use ara3n's solution.
If you want to stream more in the file, try this:
Regards
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The reason is that I will use the file to calculate a checksum for the total of all objects.
As far as I can see Your suggestion is doing the same thing as my code, execept that my code loops and concatenates all the blob references
Best Regards
The export function will overwrite the file instead of adding to it.
Best Regards