hi
i am unable to create an instream object with the blob.
I am using the XmlDom Document automation.
it is giving me the error:
'This automation variable has not been instantiated .You can do it by either creating it or assigning it.'
IF NOT CREATE(XMLDoc) THEN
ERROR('No automation');
MyRec.CALCFIELDS("XML File");
MyRec."XML File".CREATEINSTREAM(InStream);
IF NOT XMLDoc.load(InStream) THEN BEGIN
CLEAR(XMLDoc);
ERROR('No valid XML');
END;
how do you want to save the files in navision ? from the file system ? then try Field.IMPORT(<filename>) of the BLOB-Field and insert the record.
If you want to parse the content of a BLOB with a DOMDocument try this:
IF BLOBField.HASVALUE THEN BEGIN
BLOBField.CreateINSTREAM(instream);
IF DOMDocument.load(instream) THEN BEGIN
<...>
END;
END;
this works inside the table where the blob-field is placed, but maybe you need a calcfields on the blobfield befor you create the instream ?
Comments
Peter
The xmldom is being created however,
as i write the following code,
xmlDom.load();
the same error appears.
Actually i want to save some files in navision database and am looking for a solution.
If you want to parse the content of a BLOB with a DOMDocument try this:
IF BLOBField.HASVALUE THEN BEGIN
BLOBField.CreateINSTREAM(instream);
IF DOMDocument.load(instream) THEN BEGIN
<...>
END;
END;
this works inside the table where the blob-field is placed, but maybe you need a calcfields on the blobfield befor you create the instream ?
hth
RIS Plus, LLC