function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alivepjcalivepjc 

Reading Body of document

Hi,

I am trying to read the body of a document. I know that the document is base64 encoded, but the soap request returns an error.

...

$query_str = "select Id,Name,Body from document where Id = $docId";

how should this be done?

is the syntax to query documents different?

thanks!

SuperfellSuperfell
The Id part of the SOQL query needs to be in single quotes.
alivepjcalivepjc

yes, that was a typo, sorry.
we have several .doc files as mail merge docs. when I retrieve the body of the doc from the query it is encoded. I can decode (not 100% readable though), but I am having problems show it. how do I convert that into a readable string. I can deal with plain text or generate a new doc.

thank you